[boost-doc-zh] r420 committed - 翻译 unordered 库的 qbk/xml 文件

  • From: boost-doc-zh@xxxxxxxxxxxxxx
  • To: boost-doc-zh-notify@xxxxxxxxxxxxx
  • Date: Tue, 06 Jul 2010 08:49:41 +0000

Revision: 420
Author: alai04
Date: Tue Jul  6 01:48:48 2010
Log: 翻译 unordered 库的 qbk/xml 文件
http://code.google.com/p/boost-doc-zh/source/detail?r=420

Modified:
 /trunk/libs/unordered/doc/bibliography.xml
 /trunk/libs/unordered/doc/buckets.qbk
 /trunk/libs/unordered/doc/changes.qbk
 /trunk/libs/unordered/doc/comparison.qbk
 /trunk/libs/unordered/doc/hash_equality.qbk
 /trunk/libs/unordered/doc/intro.qbk
 /trunk/libs/unordered/doc/rationale.qbk
 /trunk/libs/unordered/doc/ref.xml

=======================================
--- /trunk/libs/unordered/doc/bibliography.xml  Tue Dec  8 07:08:28 2009
+++ /trunk/libs/unordered/doc/bibliography.xml  Tue Jul  6 01:48:48 2010
@@ -4,7 +4,7 @@
 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 -->
 <section id="unordered.bibliography">
-<title>Bibliography</title>
+<title>Bibliography 参考书目</title>
 <bibliography>
   <biblioentry>
     <biblioset relation="journal">
@@ -20,7 +20,8 @@
       </authorgroup>
<title><ulink url="http://www.ddj.com/cpp/184402066";>STL and TR1: Part III - Unordered containers</ulink></title>
     </biblioset>
-    <para>An introducation to the standard unordered containers.</para>
+    <para>An introducation to the standard unordered containers.<sbr/>
+    对标准无序容器的介绍。</para>
   </biblioentry>
 </bibliography>
 </section>
=======================================
--- /trunk/libs/unordered/doc/buckets.qbk       Mon Dec 28 23:05:14 2009
+++ /trunk/libs/unordered/doc/buckets.qbk       Tue Jul  6 01:48:48 2010
@@ -2,13 +2,15 @@
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ]

-[section:buckets The Data Structure]
+[section:buckets The Data Structure 数据结构]

The containers are made up of a number of 'buckets', each of which can contain any number of elements. For example, the following diagram shows an [classref boost::unordered_set unordered_set] with 7 buckets containing 5 elements, `A`, `B`, `C`, `D` and `E` (this is just for illustration, containers will typically
-have more buckets).
+have more buckets).\n
+这些容器由多个'桶'组成,每个桶可以包含任意数量的元素。例如,下图示范了一个 有7个桶、包含5个元素 A, B, C, D 和 E 的 +[classref boost::unordered_set unordered_set] (这只是用于示例的,通常的容器 会有很多桶)。

 [diagram buckets]

@@ -18,50 +20,60 @@
 so that the same terminology can be used for sets and maps). This returns a
value of type `std::size_t`. `std::size_t` has a much greater range of values then the number of buckets, so that container applies another transformation to
-that value to choose a bucket to place the element in.
+that value to choose a bucket to place the element in.\n
+为了确定将一个元素放在哪个桶中,容器要将散列函数 `Hash` 用于元素的键值(对 于 `unordered_set` 和 +`unordered_multiset`,键即为整个元素本身,不过我们还是称之为键,与 sets 和 maps 中所使用的术语保持一致)。 +函数返回一个类型为 `std::size_t` 的值。`std::size_t` 拥有比桶的数量更大的值 范围,
+所以容器要对这个值应用另一次转换,以选择某一个桶来存放元素。

Retrieving the elements for a given key is simple. The same process is applied
 to the key to find the correct bucket. Then the key is compared with the
 elements in the bucket to find any elements that match (using the equality
predicate `Pred`). If the hash function has worked well the elements will be evenly distributed amongst the buckets so only a small number of elements will
-need to be examined.
+need to be examined.\n
+根据一个给定键值取回元素也很简单。对该键值应用相同的过程,找到正确的桶。
+然后将键值与桶中的各个元素进行比较,(使用等同性谓词 `Pred`) 找到匹配的元 素。 +如果散列函数工作的好的话,各元素将均匀分布在各个桶中,则只需要测试少量的元 素。

There is [link unordered.hash_equality more information on hash functions and
-equality predicates in the next section].
+equality predicates in the next section].\n
+在下一节中,有 [link unordered.hash_equality 更多的关于散列函数和等同性谓词 的信息]。

You can see in the diagram that `A` & `D` have been placed in the same bucket. When looking for elements in this bucket up to 2 comparisons are made, making the search slower. This is known as a collision. To keep things fast we try to
-keep collisions to a minimum.
+keep collisions to a minimum.\n
+从图中你可以看到,`A` 和 `D` 被置于同一个桶中。在这个桶中查找元素需要最多 2次的比较,这使得查找减慢。
+这一情况被称为冲突。要使得查找更快,我们就要将冲突保持在最小。

 '''
-<table frame="all"><title>Methods for Accessing Buckets</title>
+<table frame="all"><title>Methods for Accessing Buckets 桶的访问方法 </title>
   <tgroup cols="2">
     <thead><row>
-      <entry><para>Method</para></entry>
-      <entry><para>Description</para></entry>
+      <entry><para>Method 方法</para></entry>
+      <entry><para>Description 说明</para></entry>
     </row></thead>
     <tbody>
       <row>
        <entry>'''`size_type bucket_count() const`'''</entry>
-       <entry>'''The number of buckets.'''</entry>
+       <entry>'''The number of buckets. 桶的数量。'''</entry>
       </row>
       <row>
         <entry>'''`size_type max_bucket_count() const`'''</entry>
-        <entry>'''An upper bound on the number of buckets.'''</entry>
+ <entry>'''An upper bound on the number of buckets. 桶数量的上 限。'''</entry>
       </row>
       <row>
         <entry>'''`size_type bucket_size(size_type n) const`'''</entry>
-        <entry>'''The number of elements in bucket `n`.'''</entry>
+ <entry>'''The number of elements in bucket `n`. 桶 `n` 中的元素数 量。'''</entry>
       </row>
       <row>
         <entry>'''`size_type bucket(key_type const& k) const`'''</entry>
- <entry>'''Returns the index of the bucket which would contain k'''</entry> + <entry>'''Returns the index of the bucket which would contain k 返 回包含k的桶的索引。'''</entry>
       </row>
       <row>
         <entry>'''`local_iterator begin(size_type n);`'''</entry>
- <entry morerows='5'>'''Return begin and end iterators for bucket `n`.'''</entry> + <entry morerows='5'>'''Return begin and end iterators for bucket `n`. 返回桶 `n` 的 begin 和 end 迭代器。'''</entry>
       </row>
       <row>
         <entry>'''`local_iterator end(size_type n);`'''</entry>
@@ -83,26 +95,33 @@
 </table>
 '''

-[h2 Controlling the number of buckets]
+[h2 Controlling the number of buckets 控制桶的数量]

As more elements are added to an unordered associative container, the number
 of elements in the buckets will increase causing performance to degrade.
To combat this the containers increase the bucket count as elements are inserted.
 You can also tell the container to change the bucket count (if required) by
-calling `rehash`.
+calling `rehash`.\n
+当越来越多的元素被加入到无序关联式容器中时,各桶中元素数量的上升会导致性能 下降。 +为防止性能的下降,容器要在元素插入时增加桶的数量。你也可以通过调用 `rehash` 来告诉容器(在需要时)改变桶的数量。

 The standard leaves a lot of freedom to the implementer to decide how the
number of buckets are chosen, but it does make some requirements based on the
 container's 'load factor', the average number of elements per bucket.
Containers also have a 'maximum load factor' which they should try to keep the
-load factor below.
+load factor below.\n
+标准留给实现者很大的自由度来决定桶的数量,不过也有基于容器的'负载因子'的一 些要求,'负载因子'即每个桶中元素的平均数量。
+容器还有一个'最大负载因子',容器会尝试将负载因子保持在'最大因子'之下。

 You can't control the bucket count directly but there are two ways to
-influence it:
+influence it:\n
+你不能直接控制桶的数量,但是有两个方法来影响它:

 * Specify the minimum number of buckets when constructing a container or
-  when calling `rehash`.
-* Suggest a maximum load factor by calling `max_load_factor`.
+  when calling `rehash`.\n
+  在构造容器时或调用 `rehash` 时指定一个最小桶数。
+* Suggest a maximum load factor by calling `max_load_factor`.\n
+  通过调用 `max_load_factor` 建议一个最大负载因子。

`max_load_factor` doesn't let you set the maximum load factor yourself, it just
 lets you give a /hint/.  And even then, the draft standard doesn't actually
@@ -110,41 +129,50 @@
load factor is /required/ to be less than the maximum is following a call to
 `rehash`. But most implementations will try to keep the number of elements
below the max load factor, and set the maximum load factor to be the same as
-or close to the hint - unless your hint is unreasonably small or large.
-
-[table Methods for Controlling Bucket Size
-    [[Method] [Description]]
+or close to the hint - unless your hint is unreasonably small or large.\n
+`max_load_factor` 并不是让你直接设定最大负载因子,它只是让你给定一个 /提示 /。 +尽管如此,标准草案并不真正要求容器必须关注这个值。只是在调用 `rehash` 后才 /要求/ 负载因子必须小于最大值。 +不过大多数实现都努力将元素数量保持在最大负载因子之下,并设置最大负载因子必 须与提示值相同或相近 - 除非你的提示值不合理地过小或过大。
+
+[table Methods for Controlling Bucket Size 控制桶大小的方法
+    [[Method 方法] [Description 说明]]

     [
         [`X(size_type n)`]
- [Construct an empty container with at least `n` buckets (`X` is the container type).] + [Construct an empty container with at least `n` buckets (`X` is the container type).\n
+        构造一个空容器,带有至少 `n` 个桶(`X` 为容器类型)。]
     ]
     [
         [`X(InputIterator i, InputIterator j, size_type n)`]
[Construct an empty container with at least `n` buckets and insert elements
-         from the range \[`i`, `j`) (`X` is the container type).]
+         from the range \[`i`, `j`) (`X` is the container type).\n
+ 构造一个空容器,带有至少 `n` 个桶,并插入区间 [`i`, `j`) 中的元素 (`X` 为容器类型)。]
     ]
     [
         [`float load_factor() const`]
-        [The average number of elements per bucket.]
+        [The average number of elements per bucket.\n
+        每个桶中的元素的平均数量]
     ]
     [
         [`float max_load_factor() const`]
-        [Returns the current maximum load factor.]
+        [Returns the current maximum load factor.\n
+        返回当前的最大负载因子]
     ]
     [
         [`float max_load_factor(float z)`]
-        [Changes the container's maximum load factor, using `z` as a hint.]
+ [Changes the container's maximum load factor, using `z` as a hint.\n
+        修改容器的最大负载因子,以 `z` 作为提示。]
     ]
     [
         [`void rehash(size_type n)`]
[Changes the number of buckets so that there at least n buckets, and
-        so that the load factor is less than the maximum load factor.]
+        so that the load factor is less than the maximum load factor.\n
+        修改桶的数量,至少为 `n` 个桶,且负载因子小于最大负载因子]
     ]

 ]

-[h2 Iterator Invalidation]
+[h2 Iterator Invalidation 迭代器的失效]

 It is not specified how member functions other than `rehash` affect
 the bucket count, although `insert` is only allowed to invalidate iterators
@@ -152,13 +180,18 @@
maximum load factor. For most implementations this means that insert will only
 change the number of buckets when this happens. While iterators can be
invalidated by calls to `insert` and `rehash`, pointers and references to the
-container's elements are never invalidated.
+container's elements are never invalidated.\n
+除了 `rehash` 以外,其它成员函数如何影响桶的数量并没有规定,`insert` 操作仅 当插入导致负载因子大于或等于最大负载因子时允许使得迭代器失效。
+对于多数实现来说,这意味着只有当此事发生时,插入操作才会改变桶的数量。
+因此,迭代器只会在调用 `insert` 和 `rehash` 时才可能失效,而指向容器中的元 素的指针和引用则永不失效。

 In a similar manner to using `reserve` for `vector`s, it can be a good idea
 to call `rehash` before inserting a large number of elements. This will get
 the expensive rehashing out of the way and let you store iterators, safe in
 the knowledge that they won't be invalidated. If you are inserting `n`
-elements into container `x`, you could first call:
+elements into container `x`, you could first call:\n
+和对 `vectors` 使用 `reserve` 一样,在往无序关联式容器中插入大量元素之 前,最好先调用 `rehash`。 +这样可以避免不必要的代价昂贵的重散列,让你可以保存迭代器,并确知它们不会失 效。如果你要往容器 `x` 中插入 `n` 个元素,你可以先调用:

     x.rehash((x.size() + n) / x.max_load_factor() + 1);

@@ -166,6 +199,9 @@
number of elements, which is why the new size is divided by the maximum load factor. The `+ 1` guarantees there is no invalidation; without it, reallocation could occur if the number of bucket exactly divides the target size, since the container is -allowed to rehash when the load factor is equal to the maximum load factor.] +allowed to rehash when the load factor is equal to the maximum load factor.\n +注:`rehash` 的参数是桶的最小数量,而不是元素数量,所以新的大小要除以最大负 载因子。 +而 `+ 1` 则保证了不会失效;不这样的话,如果桶的数量正好可以整除目标大小,就 可能发生重分配,
+因为当负载因子达到最大负载因子时可以允许容器重散列。]

 [endsect]
=======================================
--- /trunk/libs/unordered/doc/changes.qbk       Mon May 31 02:08:39 2010
+++ /trunk/libs/unordered/doc/changes.qbk       Tue Jul  6 01:48:48 2010
@@ -3,119 +3,169 @@
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ]

-[section:changes Change Log]
-
-[h2 Review Version]
+[section:changes Change Log 变更历史]
+
+[h2 Review Version 审查版本]

 Initial review version, for the review conducted from 7th December 2007 to
-16th December 2007.
+16th December 2007.\n
+初始的审查版本,用于从 7th December 2007 到 16th December 2007 的审查。

 [h2 1.35.0 Add-on - 31st March 2008]

Unofficial release uploaded to vault, to be used with Boost 1.35.0. Incorporated
-many of the suggestions from the review.
-
-* Improved portability thanks to Boost regression testing.
-* Fix lots of typos, and clearer text in the documentation.
+many of the suggestions from the review.\n
+非正式发布,上载到 vault 中,与 Boost 1.35.0 一起使用。集合了审查中的许多建 议。
+
+* Improved portability thanks to Boost regression testing.\n
+  改进了可移植性,感谢 Boost regression 测试。
+* Fix lots of typos, and clearer text in the documentation.\n
+  修正多处笔误,使得文档更为清晰。
* Fix floating point to `std::size_t` conversion when calculating sizes from - the max load factor, and use `double` in the calculation for greater accuracy.
-* Fix some errors in the examples.
+ the max load factor, and use `double` in the calculation for greater accuracy.\n + 在从最大负载因子计算大小时,修正了浮点数到 `std::size_t` 的转换,对于更高 精度的计算,则使用 `double`。
+* Fix some errors in the examples.\n
+  修正了例子中的一些错误

 [h2 Boost 1.36.0]

-First official release.
-
-* Rearrange the internals.
+First official release.\n
+第一次正式发布。
+
+* Rearrange the internals.\n
+  内部的重新整理。
* Move semantics - full support when rvalue references are available, emulated
-  using a cut down version of the Adobe move library when they are not.
-* Emplace support when rvalue references and variadic template are available.
+  using a cut down version of the Adobe move library when they are not.\n
+ 移动语义 - 当右值引用可用时完全支持,当右值引用不可用时使用 Adobe move 库 的一个裁减版本来模仿。 +* Emplace support when rvalue references and variadic template are available.\n
+  当右值引用和可变参数模板可用时,支持 emplace。
* More efficient node allocation when rvalue references and variadic template
-  are available.
-* Added equality operators.
+  are available.\n
+  当右值引用和可变参数模板可用时,更高效的节点分配
+* Added equality operators.\n
+  增加了相等操作符。

 [h2 Boost 1.37.0]

 * Rename overload of `emplace` with hint, to `emplace_hint` as specified in
- [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2691.pdf n2691]. + [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2691.pdf n2691].\n + 按照 [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2691.pdf n2691]
+  中的说明,将带提示的 `emplace` 重载函数更名为 `emplace_hint`。
* Provide forwarding headers at `<boost/unordered/unordered_map_fwd.hpp>` and
-  `<boost/unordered/unordered_set_fwd.hpp>`.
+  `<boost/unordered/unordered_set_fwd.hpp>`.\n
+ 在 `<boost/unordered/unordered_map_fwd.hpp>` 和 `<boost/unordered/unordered_set_fwd.hpp>` 中提供前向头文件。
 * Move all the implementation inside `boost/unordered`, to assist
- modularization and hopefully make it easier to track changes in subversion. + modularization and hopefully make it easier to track changes in subversion.\n + 将所有实现移至 `boost/unordered` 内,以提高模块化并更易于在 subversion 中 进行变更跟踪。

 [h2 Boost 1.38.0]

-* Use [@boost:/libs/utility/swap.html `boost::swap`].
+* Use [@boost:/libs/utility/swap.html `boost::swap`].\n
+  使用 [@boost:/libs/utility/swap.html `boost::swap`].
 * [@https://svn.boost.org/trac/boost/ticket/2237 Ticket 2237]:
   Document that the equality and inequality operators are undefined for two
   objects if their equality predicates aren't equivalent. Thanks to Daniel
-  Krügler.
+  Krügler.\n
+  [@https://svn.boost.org/trac/boost/ticket/2237 Ticket 2237]:
+ 文档记录:如果两个对象的相等谓词不等价,则它们的相等操作符和不等操作符均 未定义。感谢 Daniel Krügler.
 * [@https://svn.boost.org/trac/boost/ticket/1710 Ticket 1710]:
   Use a larger prime number list. Thanks to Thorsten Ottosen and Hervé
-  Brönnimann.
+  Brönnimann.\n
+  [@https://svn.boost.org/trac/boost/ticket/1710 Ticket 1710]:
+  使用了一个更大的质数列表。感谢 Thorsten Ottosen 和 Hervé Brönnimann.
 * Use
[@boost:/libs/type_traits/doc/html/boost_typetraits/category/alignment.html aligned storage] to store the types. This changes the way the allocator is
   used to construct nodes. It used to construct the node with two calls to
the allocator's `construct` method - once for the pointers and once for the
   value. It now constructs the node with a single call to construct and
-  then constructs the value using in place construction.
+  then constructs the value using in place construction.\n
+ 使用 [@boost:/libs/type_traits/doc/html/boost_typetraits/category/alignment.html 对齐存储] 来保存类型。 + 这修改了用于构造节点的分配器方式。以往构造一个节点需要两次调用分配器的 construct 方法 - 一次用于指针,另一次用于值。
+  现在构造一个节点只需要一次调用,然后使用就地构造来对值进行构造。
* Add support for C++0x initializer lists where they're available (currently
-  only g++ 4.4 in C++0x mode).
+  only g++ 4.4 in C++0x mode).\n
+ 在可用时,增加对 C++0x 初始化列表的支持(当前仅在 C++0x 模式的 g++ 4.4 下 可用)。

 [h2 Boost 1.39.0]

* [@https://svn.boost.org/trac/boost/ticket/2756 Ticket 2756]: Avoid a warning
-  on Visual C++ 2009.
+  on Visual C++ 2009.\n
+ [@https://svn.boost.org/trac/boost/ticket/2756 Ticket 2756]: 避免在 Visual C++ 2009 上的一个警告。
 * Some other minor internal changes to the implementation, tests and
-  documentation.
-* Avoid an unnecessary copy in `operator[]`.
+  documentation.\n
+  对于实现细节、测试和文档的一些其它细小的内部变化。
+* Avoid an unnecessary copy in `operator[]`.\n
+  避免在 `operator[]` 中的一个不必要的复制。
* [@https://svn.boost.org/trac/boost/ticket/2975 Ticket 2975]: Fix length of
-  prime number list.
+  prime number list.\n
+ [@https://svn.boost.org/trac/boost/ticket/2975 Ticket 2975]: 固定长度的质 数表。

 [h2 Boost 1.40.0]

 * [@https://svn.boost.org/trac/boost/ticket/2975 Ticket 2975]:
Store the prime list as a preprocessor sequence - so that it will always get
-  the length right if it changes again in the future.
+  the length right if it changes again in the future.\n
+  [@https://svn.boost.org/trac/boost/ticket/2975 Ticket 2975]:
+ 将质数表保存为一个预处理器序列 - 这样如果以后再次变更,也总能获得正确的长 度。
 * [@https://svn.boost.org/trac/boost/ticket/1978 Ticket 1978]:
-  Implement `emplace` for all compilers.
+  Implement `emplace` for all compilers.\n
+ [@https://svn.boost.org/trac/boost/ticket/1978 Ticket 1978]: 为所有编译器 实现 `emplace`。
 * [@https://svn.boost.org/trac/boost/ticket/2908 Ticket 2908],
   [@https://svn.boost.org/trac/boost/ticket/3096 Ticket 3096]:
   Some workarounds for old versions of borland, including adding explicit
-  destructors to all containers.
+  destructors to all containers.\n
+  [@https://svn.boost.org/trac/boost/ticket/2908 Ticket 2908],
+  [@https://svn.boost.org/trac/boost/ticket/3096 Ticket 3096]:
+ 针对旧版本的 borland 编译器的一些变通方法,包括为所有容器增加显式析构函 数。
 * [@https://svn.boost.org/trac/boost/ticket/3082 Ticket 3082]:
-  Disable incorrect Visual C++ warnings.
-* Better configuration for C++0x features when the headers aren't available.
-* Create less buckets by default.
-
-[h2 Boost 1.41.0 - Major update]
+  Disable incorrect Visual C++ warnings.\n
+ [@https://svn.boost.org/trac/boost/ticket/3082 Ticket 3082]: 禁止不正确 的 Visual C++ 警告。 +* Better configuration for C++0x features when the headers aren't available.\n
+  当头文件不可用时,可更好地配置 C++0x 的特性。
+* Create less buckets by default.\n
+  缺省情况下创建量少的桶。
+
+[h2 Boost 1.41.0 - Major update 重要更新]

* The original version made heavy use of macros to sidestep some of the older
   compilers' poor template support. But since I no longer support those
compilers and the macro use was starting to become a maintenance burden it has been rewritten to use templates instead of macros for the implementation
-  classes.
+  classes.\n
+  原先的版本使用了大量宏来解决一些旧编译器对于模板的较差的支持。
+ 但是由于我们不再支持这些旧编译器,而且这些宏的使用已经开始成为沉重的维护 负担,所以我们进行了重写,使用模板代替宏来实现这些类。

* The container objcet is now smaller thanks to using `boost::compressed_pair` for EBO and a slightly different function buffer - now using a bool instead
-  of a member pointer.
+  of a member pointer.\n
+ 容器对象更小了,归功于对EBO使用了 `boost::compressed_pair` 以及一个稍微不 一样的函数缓冲 - 使用一个 `bool` 值来替代成员指针。

* Buckets are allocated lazily which means that constructing an empty container
-  will not allocate any memory.
+  will not allocate any memory.\n
+  桶的分配被延迟,这意味着构造一个空的容器将不分配任何内存。

 [h2 Boost 1.42.0]

-* Support instantiating the containers with incomplete value types.
-* Reduced the number of warnings (mostly in tests).
-* Improved codegear compatibility.
+* Support instantiating the containers with incomplete value types.\n
+  支持带不完整值类型的容器的实例化。
+* Reduced the number of warnings (mostly in tests).\n
+  减少了告警数量(主要是测试中的)。
+* Improved codegear compatibility.\n
+  提升了 codegear 兼容性。
 * [@http://svn.boost.org/trac/boost/ticket/3693 Ticket 3693]:
   Add `erase_return_void` as a temporary workaround for the current
   `erase` which can be inefficient because it has to find the next
-  element to return an iterator.
-* Add templated find overload for compatible keys.
+  element to return an iterator.\n
+  [@http://svn.boost.org/trac/boost/ticket/3693 Ticket 3693]:
+ 由于当前的 `erase` 必须查找下一元素以返回迭代器,这有可能很低效,所以增加 了 `erase_return_void` 作为临时的变通。
+* Add templated find overload for compatible keys.\n
+  增加了针对兼容键的模板化 find 重载。
 * [@http://svn.boost.org/trac/boost/ticket/3773 Ticket 3773]:
-  Add missing `std` qualifier to `ptrdiff_t`.
-* Some code formatting changes to fit almost all lines into 80 characters.
+  Add missing `std` qualifier to `ptrdiff_t`.\n
+ [@http://svn.boost.org/trac/boost/ticket/3773 Ticket 3773]: 为 `ptrdiff_t` 增加漏掉的 `std` 限定。 +* Some code formatting changes to fit almost all lines into 80 characters.\n
+  修改了一些代码格式以适应所有行长小于80个字符。

 [h2 Boost 1.43.0]

@@ -125,8 +175,13 @@
   current forerunner for resolving the slow erase by iterator], although
   there's a strong possibility that this may change in the future. The old
method name remains for backwards compatibility but is considered deprecated
-  and will be removed in a future release.
-* Use Boost.Exception.
-* Stop using deprecated `BOOST_HAS_*` macros.
+  and will be removed in a future release.\n
+  [@http://svn.boost.org/trac/boost/ticket/3966 Ticket 3966]:
+ `erase_return_void` 现在改为 `quick_erase`,它是 [@http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#579 + 解决使用迭代器进行删除过慢的当前预测版],不过未来很有可能会有变化。旧的方 法名因后向兼容性而被保留,但会在以后版本中被移除。
+* Use Boost.Exception.\n
+  使用 Boost.Exception.
+* Stop using deprecated `BOOST_HAS_*` macros.\n
+  停止使用 `BOOST_HAS_*` 宏。

 [endsect]
=======================================
--- /trunk/libs/unordered/doc/comparison.qbk    Mon Dec 28 23:05:14 2009
+++ /trunk/libs/unordered/doc/comparison.qbk    Tue Jul  6 01:48:48 2010
@@ -2,161 +2,219 @@
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ]

-[section:comparison Comparison with Associative Containers]
-
-[table Interface differences.
-    [[Associative Containers] [Unordered Associative Containers]]
+[section:comparison Comparison with Associative Containers 与关联式容器的比 较]
+
+[table Interface differences. 接口的差异。
+ [[Associative Containers 关联式容器] [Unordered Associative Containers 无序关联式容器]]

     [
-        [Parameterized by an ordering relation `Compare`]
+        [Parameterized by an ordering relation `Compare`\n
+        以一个排序关系 `Compare` 来参数化]
[Parameterized by a function object `Hash` and an equivalence relation
-            `Pred`]
+            `Pred`\n
+        以一个函数对象 `Hash` 和一个等同性关系 `Pred` 来参数化]
     ]
     [
[Keys can be compared using `key_compare` which is accessed by member function `key_comp()`, - values can be compared using `value_compare` which is accessed by member function `value_comp()`.] + values can be compared using `value_compare` which is accessed by member function `value_comp()`.\n + 键值可以使用 `key_compare` 来比较,后者通过成员函数 `key_comp()` 来访问,值可以使用 `value_compare`
+         来比较,后者通过成员函数 `value_comp()` 来访问。]
[Keys can be hashed using `hasher` which is accessed by member function `hash_function()`, and checked for equality using `key_equal` which is accessed by member function `key_eq()`.
-         There is no function object for compared or hashing values.]
+         There is no function object for compared or hashing values.\n
+ 键值可以用 `hasher` 来散列,它通过成员函数 `hash_function()` 访 问,并且键值使用 `key_equal` + 来检查等同性,它通过成员函数 `key_eq()` 访问。没有函数对象用于对值 进行比较或散列。]
     ]
     [
- [Constructors have optional extra parameters for the comparison object.] + [Constructors have optional extra parameters for the comparison object.\n
+        构造函数有可选的额外参数用于比较用的函数对象。]
[Constructors have optional extra parameters for the initial minimum
-            number of buckets, a hash function and an equality object.]
+            number of buckets, a hash function and an equality object.\n
+ 构造函数有可选的额外参数,用于初始化最小的桶数量、散列函数和等同性 函数对象。]
     ]

     [
         [Keys `k1`, `k2` are considered equivalent if
-            `!Compare(k1, k2) && !Compare(k2, k1)`]
-        [Keys `k1`, `k2` are considered equivalent if `Pred(k1, k2)`]
+            `!Compare(k1, k2) && !Compare(k2, k1)`\n
+ 键值 `k1`, `k2` 被认为是相等的,如果 `!Compare(k1, k2) && !Compare(k2, k1)`]
+        [Keys `k1`, `k2` are considered equivalent if `Pred(k1, k2)`\n
+        键值 `k1`, `k2` 被认为是相等的,如果 `Pred(k1, k2)`]
     ]
     [
-        [Member function `lower_bound(k)` and `upper_bound(k)`]
+        [Member function `lower_bound(k)` and `upper_bound(k)`\n
+        成员函数 `lower_bound(k)` 和 `upper_bound(k)`]
         [No equivalent. Since the elements aren't ordered `lower_bound` and
-        `upper_bound` would be meaningless.]
+        `upper_bound` would be meaningless.\n
+ 没有相应的成员函数。因为元素不是有序的,`lower_bound` 和 `upper_bound` 没有意义。]
     ]
     [
         [`equal_range(k)` returns an empty range at the position that k
-            would be inserted if k isn't present in the container.]
+            would be inserted if k isn't present in the container.\n
+ 如果 `k` 不在容器中,`equal_range(k)` 返回一个空区间,位于 `k` 可以 被插入的位置。]
         [`equal_range(k)` returns a range at the end of the container if
             k isn't present in the container. It can't return a positioned
range as k could be inserted into multiple place. To find out the bucket that k would be inserted into use `bucket(k)`. But remember that an insert can cause the container to rehash - meaning that the
-            element can be inserted into a different bucket.]
+            element can be inserted into a different bucket.\n
+ 如果 `k` 不在容器中,`equal_range(k)` 返回位于容器末尾的区间。它不 能返回一个定位的区间,因为 `k` 可能被插入以多个地方。 + 要找出 `k` 将被插入的桶,要用 `bucket(k)`。不过请记住,插入操作可能 引起容器的重散列 - 这意味着该元素可能被插入到另一个桶中。]
     ]
     [
-        [`iterator`, `const_iterator` are of the bidirectional category.]
- [`iterator`, `const_iterator` are of at least the forward category.]
+        [`iterator`, `const_iterator` are of the bidirectional category.\n
+        `iterator`, `const_iterator` 为双向迭代器类别。]
+ [`iterator`, `const_iterator` are of at least the forward category.\n
+        `iterator`, `const_iterator` 至少为前向迭代器类型。]
     ]
     [
         [Iterators, pointers and references to the container's elements are
-            never invalidated.]
+            never invalidated.\n
+        指向容器元素的迭代器、指针和引用都不会失效。]
         [[link unordered.buckets.iterator_invalidation Iterators can
             be invalidated by calls to insert or rehash]. Pointers and
-            references to the container's elements are never invalidated.]
+            references to the container's elements are never invalidated.\n
+ [link unordered.buckets.iterator_invalidation 调用 insert 或 rehash 可能引起迭代器失效]。而指向容器元素的指针和引用则不会失效。]
     ]
     [
         [Iterators iterate through the container in the order defined by
-            the comparison object.]
+            the comparison object.\n
+            迭代器按照由比较函数对象所定义的顺序遍历容器。]
[Iterators iterate through the container in an arbitrary order, that can change as elements are inserted. Although, equivalent elements
-            are always adjacent.]
+            are always adjacent.\n
+ 迭代器按任意顺序遍历容器,由元素被插入时还可能改变。不过,相等 的元素总是保持连续的。]
     ]
     [
-        [No equivalent]
+        [No equivalent\n
+        无对应物]
         [Local iterators can be used to iterate through individual buckets.
(I don't think that the order of local iterators and iterators are
-            required to have any correspondence.)]
+            required to have any correspondence.)\n
+ 局部迭代器可以用于遍历单个桶。(我不认为局部迭代器和迭代器的顺序 有任何对应物)]
     ]
     [
- [Can be compared using the `==`, `!=`, `<`, `<=`, `>`, `>=` operators.] + [Can be compared using the `==`, `!=`, `<`, `<=`, `>`, `>=` operators.\n
+        可以用 `==`, `!=`, `<`, `<=`, `>`, `>=` 操作符进行比较。]
         [No comparison operators are defined in the standard, although
             [link unordered.rationale.equality_operators
             implementations might extend the containers to support `==` and
-            `!=`].]
+            `!=`].\n
+ 在标准中没有定义比较操作符,不过 [link unordered.rationale.equality_operators 实现对容器进行扩展以支持 `==` 和 `!=`]。]
     ]
     [
         []
[When inserting with a hint, implementations are permitted to ignore
-            the hint.]
+            the hint.\n
+            在带提示的插入操作时,实现被允许可以忽略提示。]
     ]
     [
-        [`erase` never throws an exception]
+        [`erase` never throws an exception\n
+        `erase` 不会抛出异常]
         [The containers' hash or predicate function can throw exceptions
-            from `erase`]
+            from `erase`\n
+            容器的散列函数和谓词函数可以从 `erase` 抛出异常]
     ]
 ]

-[table Complexity Guarantees
- [[Operation] [Associative Containers] [Unordered Associative Containers]]
+[table Complexity Guarantees 复杂度保证
+ [[Operation 操作] [Associative Containers 关联式容器] [Unordered Associative Containers 无序关联式容器]]
     [
-        [Construction of empty container]
-        [constant]
-        [O(/n/) where /n/ is the minimum number of buckets.]
+        [Construction of empty container\n
+        空容器的构造]
+        [constant\n
+        常数]
+        [O(/n/) where /n/ is the minimum number of buckets.\n
+        O(/n/) 其中 /n/ 为桶的最小数量。]
     ]
     [
-        [Construction of container from a range of /N/ elements]
-        [O(/N/ log /N/), O(/N/) if the range is sorted with `value_comp()`]
+        [Construction of container from a range of /N/ elements\n
+        从带有 /N/ 个元素的区间构造容器]
+ [O(/N/ log /N/), O(/N/) if the range is sorted with `value_comp()`\n
+        O(/N/ log /N/), O(/N/) 如果区间已按 `value_comp()` 排序]
         [Average case O(/N/), worst case
-            O(/N/'''<superscript>2</superscript>''')]
+            O(/N/'''<superscript>2</superscript>''')\n
+ 平均情况 O(/N/), 最坏情况 O(/N/'''<superscript>2</superscript>''') ]
     ]
     [
-        [Insert a single element]
-        [logarithmic]
-        [Average case constant, worst case linear]
+        [Insert a single element\n
+        插入单个元素]
+        [logarithmic\n
+        对数]
+        [Average case constant, worst case linear\n
+        平均情况为常数时间,最坏情况为线性时间]
     ]
     [
-        [Insert a single element with a hint]
+        [Insert a single element with a hint\n
+        带提示插入单个元素]
         [Amortized constant if t elements inserted right after hint,
-            logarithmic otherwise]
+            logarithmic otherwise\n
+ 如果插入的元素恰好在提示位置之后,则为分期常数时间,否则为对数 时间]
         [Average case constant, worst case linear (ie. the same as
-            a normal insert).]
+            a normal insert).\n
+            平均情况为常数时间,最坏情况为线性时间(即与普通插入一样)]
     ]
     [
-        [Inserting a range of /N/ elements]
+        [Inserting a range of /N/ elements\n
+        插入 /N/ 个元素的区间]
         [ /N/ log(`size()`+/N/) ]
-        [Average case O(/N/), worst case O(/N/ * `size()`)]
+        [Average case O(/N/), worst case O(/N/ * `size()`)\n
+        平均情况为 O(/N/),最坏情况为 O(/N/ * `size()`) ]
     ]
     [
-        [Erase by key, `k`]
+        [Erase by key, `k`\n
+        通过键值 `k` 删除元素]
         [O(log(`size()`) + `count(k)`)]
-        [Average case: O(`count(k)`), Worst case: O(`size()`)]
+        [Average case: O(`count(k)`), Worst case: O(`size()`)\n
+        平均情况:O(`count(k)`),最坏情况:O(`size()`)]
     ]
     [
-        [Erase a single element by iterator]
-        [Amortized constant]
-        [Average case: O(1), Worst case: O(`size()`)]
+        [Erase a single element by iterator\n
+        通过迭代器删除单个元素]
+        [Amortized constant\n
+        分期常数时间]
+        [Average case: O(1), Worst case: O(`size()`)\n
+        平均情况:O(1),最坏情况:O(`size()`)]
     ]
     [
-        [Erase a range of /N/ elements]
+        [Erase a range of /N/ elements\n
+        删除 /N/ 个元素的区间]
         [O(log(`size()`) + /N/)]
-        [Average case: O(/N/), Worst case: O(`size()`)]
+        [Average case: O(/N/), Worst case: O(`size()`)\n
+        平均情况:O(/N/),最坏情况: O(`size()`)]
     ]
     [
-        [Clearing the container]
+        [Clearing the container\n
+        清空容器]
         [O(`size()`)]
         [O(`size()`)]
     ]
     [
-        [Find]
-        [logarithmic]
-        [Average case: O(1), Worst case: O(`size()`)]
+        [Find\n
+        查找]
+        [logarithmic\n
+        对数时间]
+        [Average case: O(1), Worst case: O(`size()`)\n
+        平均情况:O(1),最坏情况: O(`size()`)]
     ]
     [/ TODO: Average case is probably wrong. ]
     [
-        [Count]
+        [Count\n
+        计数]
         [O(log(`size()`) + `count(k)`)]
-        [Average case: O(1), Worst case: O(`size()`)]
+        [Average case: O(1), Worst case: O(`size()`)\n
+        平均情况:O(1),最坏情况: O(`size()`)]
     ]
     [
         [`equal_range(k)`]
-        [logarithmic]
-        [Average case: O(`count(k)`), Worst case: O(`size()`)]
+        [logarithmic\n
+        对数时间]
+        [Average case: O(`count(k)`), Worst case: O(`size()`)\n
+        平均情况:O(`count(k)`),最坏情况:O(`size()`) ]
     ]
     [
         [`lower_bound`,`upper_bound`]
-        [logarithmic]
+        [logarithmic\n
+        对数时间]
         [n/a]
     ]
 ]
=======================================
--- /trunk/libs/unordered/doc/hash_equality.qbk Mon Dec 28 23:05:14 2009
+++ /trunk/libs/unordered/doc/hash_equality.qbk Tue Jul  6 01:48:48 2010
@@ -2,12 +2,14 @@
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ]

-[section:hash_equality Equality Predicates and Hash Functions]
+[section:hash_equality Equality Predicates and Hash Functions 等同性谓词和 散列函数]

While the associative containers use an ordering relation to specify how the
 elements are stored, the unordered associative containers use an equality
 predicate and a hash function. For example, [classref boost::unordered_map]
-is declared as:
+is declared as:\n
+关联式容器使用一个排序关系来指定如何保存元素,而无序关联式容器则使用一个等 同性谓词和一个散列函数。
+例如,[classref boost::unordered_map] 被声明为:

         template <
             class Key, class Mapped,
@@ -18,28 +20,36 @@

 The hash function comes first as you might want to change the hash function
 but not the equality predicate. For example, if you wanted to use the
-[@http://www.isthe.com/chongo/tech/comp/fnv/ FNV-1 hash] you could write:
+[@http://www.isthe.com/chongo/tech/comp/fnv/ FNV-1 hash] you could write:\n
+散列函数被放在前面,因为你可能想修改散列函数而不修改等同性谓词。例如,如果 你想使用
+[@http://www.isthe.com/chongo/tech/comp/fnv/ FNV-1 hash],你可以写:

 [import src_code/dictionary.cpp]
 [case_sensitive_dictionary_fnv]

 There is an [@boost:/libs/unordered/examples/fnv1.hpp implementation
-of FNV-1] in the examples directory.
+of FNV-1] in the examples directory.\n
+在 examples 目录下有一个 [@boost:/libs/unordered/examples/fnv1.hpp FNV-1 的 实现]。

 If you wish to use a different equality function,
 you will also need to use a matching hash function. For
 example, to implement a case insensitive dictionary you need to define a
-case insensitive equality predicate and hash function:
+case insensitive equality predicate and hash function:\n
+如果你希望使用一个不同的等同性谓词,你也需要使用一个相匹配的散列函数。
+例如,要实现一个大小写不敏感的字典,你需要定义一个大小写不敏感的等同性谓词 和散列函数:

 [case_insensitive_functions]

-Which you can then use in a case insensitive dictionary:
+Which you can then use in a case insensitive dictionary:\n
+然后你就可以在大小写不敏感的字典中使用它们了:

 [case_insensitive_dictionary]

 This is a simplified version of the example at
[@boost:/libs/unordered/examples/case_insensitive.hpp /libs/unordered/examples/case_insensitive.hpp]
-which supports other locales and string types.
+which supports other locales and string types.\n
+在 [@boost:/libs/unordered/examples/case_insensitive.hpp /libs/unordered/examples/case_insensitive.hpp]
+中有这个例子的简化版本,它支持其它的 locales 和字符串类型。

 [caution
 Be careful when using the equality (`==`) operator with custom equality
@@ -48,37 +58,47 @@
 For most stateless function objects this is impossible - since you can only
 compare objects with the same equality predicate you know the equality
predicates must be equal. But if you're using function pointers or a stateful
-equality predicate (e.g. boost::function) then you can get into trouble.
+equality predicate (e.g. boost::function) then you can get into trouble.\n
+将相等操作符(`==`) 与定制的相等性谓词一起使用时要特别小心,尤其是当你在使用 函数指针时。
+如果你对两个具有不同相等性谓词的容器进行比较,其结果是未定义的。
+对于大多数无状态的函数对象来说,这是不可能的 - 因为你只能比较带有同一个相等 性谓词的对象,你知道它们的相等性谓词肯定是一样的。 +但是如果你使用的是函数指针或有状态的相等性谓词(如 boost::function),则你会 陷入麻烦。
 ]

-[h2 Custom Types]
-
-Similarly, a custom hash function can be used for custom types:
+[h2 Custom Types 定制类型]
+
+Similarly, a custom hash function can be used for custom types:\n
+同样,对于定制的类型可以使用定制的散列函数:

 [import src_code/point1.cpp]
 [point_example1]

 Since the default hash function is [link hash Boost.Hash],
 we can [link hash.custom extend it to support the type]
-so that the hash function doesn't need to be explicitly given:
+so that the hash function doesn't need to be explicitly given:\n
+由于缺省的散列函数是 [link hash Boost.Hash],我们可以 [link hash.custom 对 它进行扩展以支持这个类型],所以散列函数不需要显式给出:

 [import src_code/point2.cpp]
 [point_example2]

See the [link hash.custom Boost.Hash documentation] for more detail on how to do this. Remember that it relies on extensions to the draft standard - so it -won't work on other implementations of the unordered associative containers.
-
-[table Methods for accessing the hash and equality functions.
-    [[Method] [Description]]
+won't work on other implementations of the unordered associative containers.\n
+关于如何实现的更多细节,请见 [link hash.custom Boost.Hash 文档]。
+记住,它依赖于标准草案的扩展部分 - 所以它在无序关联式容器的其它实现中不一定 可用。
+
+[table Methods for accessing the hash and equality functions. 访问散列函数 和等同性函数的方法。
+    [[Method 方法] [Description 说明]]

     [
         [`hasher hash_function() const`]
-        [Returns the container's hash function.]
+        [Returns the container's hash function.\n
+        返回容器的散列函数。]
     ]
     [
         [`key_equal key_eq() const`]
-        [Returns the container's key equality function.]
+        [Returns the container's key equality function.\n
+        返回容器的键类型的等同性函数。]
     ]
 ]

=======================================
--- /trunk/libs/unordered/doc/intro.qbk Mon Dec 28 23:05:14 2009
+++ /trunk/libs/unordered/doc/intro.qbk Tue Jul  6 01:48:48 2010
@@ -16,7 +16,7 @@
 [def __hash-function__ [@http://en.wikipedia.org/wiki/Hash_function
     hash function]]

-[section:intro Introduction]
+[section:intro Introduction 简介]

For accessing data based on key lookup, the C++ standard library offers `std::set`,
 `std::map`, `std::multiset` and `std::multimap`. These are generally
@@ -24,22 +24,30 @@
 logarithmic complexity. That is generally okay, but in many cases a
__hash-table__ can perform better, as accessing data has constant complexity,
 on average. The worst case complexity is linear, but that occurs rarely and
-with some care, can be avoided.
+with some care, can be avoided.\n
+在基于键值查找的数据访问方面,C++标准库提供了 `std::set`, `std::map`, `std::multiset` 和 `std::multimap`。 +它们通常都是使用平衡树来实现的,这样查找时间具有对数复杂度。通常来说这是 OK的,不过在多数情况下 __hash-table__ +可以表现得更好,平均而言它对数据的访问是常量复杂度的。最坏情况下的复杂度则 是线性的,不过这种情况极少发生,而且留意一下是可以避免的。

 Also, the existing containers require a 'less than' comparison object
to order their elements. For some data types this is impossible to implement or isn't practical. In contrast, a hash table only needs an equality function
-and a hash function for the key.
+and a hash function for the key.\n
+还有,已有的容器要求一个'小于'比较对象来对元素进行排序。对于某些数据,这是 不可能实现或不实际的。
+相比之下,散列表只需要用于键值的一个等同性函数和一个散列函数。

With this in mind, the __tr1__ introduced the unordered associative containers, which are implemented using hash tables, and they have now been added to the
-__draft__.
+__draft__.\n
+对于这一点,__tr1__ 引入了无序关联式容器,它们是用散列表来实现的,它们已经 被加入到 __draft__ 之中了。

This library supplies an almost complete implementation of the specification in
-the __draft__.
+the __draft__.\n
+本库提供了一个符合 __draft__ 规范的基本完整的实现。

 `unordered_set` and `unordered_multiset` are defined in the header
-<[headerref boost/unordered_set.hpp]>
+<[headerref boost/unordered_set.hpp]>\n
+`unordered_set` 和 `unordered_multiset` 定义于头文件 <[headerref boost/unordered_set.hpp]> 中

     namespace boost {
         template <
@@ -58,7 +66,8 @@
     }

 `unordered_map` and `unordered_multimap` are defined in the header
-<[headerref boost/unordered_map.hpp]>
+<[headerref boost/unordered_map.hpp]>\n
+`unordered_map` 和 `unordered_multimap` 定义于头文件 <[headerref boost/unordered_map.hpp]> 中

     namespace boost {
         template <
@@ -77,19 +86,23 @@
     }

 When using Boost.TR1, these classes are included from `<unordered_set>` and
-`<unordered_map>`, with the classes added to the `std::tr1` namespace.
+`<unordered_map>`, with the classes added to the `std::tr1` namespace.\n
+在使用 Boost.TR1 时,这些类包含在 `<unordered_set>` 和 `<unordered_map>` 中,而且被添加到 `std::tr1` 名字空间中。

 The containers are used in a similar manner to the normal associative
-containers:
+containers:\n
+这些容器的使用方式与普通的关联式容器相似:

 [import src_code/intro.cpp]
 [intro_example1_2]

-But since the elements aren't ordered, the output of:
+But since the elements aren't ordered, the output of:\n
+不过由于其中的元素是无序的,所以以下语句的输出:

 [intro_example1_3]

-can be in any order. For example, it might be:
+can be in any order. For example, it might be:\n
+可以是任意顺序。例如,它可能是:

     two,2
     one,1
@@ -104,9 +117,15 @@
 you have to [link hash.custom extend Boost.Hash to support the type] or use
 your own custom equality predicates and hash functions. See the
[link unordered.hash_equality Equality Predicates and Hash Functions] section
-for more details.
+for more details.\n
+要将一个对象保存在无序关联式容器中,需要有一个键值等同性函数和一个散列函 数。 +在标准容器中的缺省函数对象支持少量基本类型,包括整数类型、浮点数类型、指针 类型和标准字符串。 +由于 Boost.Unordered 使用了 [classref boost::hash],所以它还支持一些其它的 类型,包括标准容器。 +要将这些方法用于尚不支持的类型,你必须 [link hash.custom 扩展 Boost.Hash] 以支持该类型,或者使用你自己定制的等同性谓词和散列函数。
+更多细节请见 [link unordered.hash_equality 等同性谓词和散列函数] 一节。

 There are other differences, which are listed in the
-[link unordered.comparison Comparison with Associative Containers] section.
+[link unordered.comparison Comparison with Associative Containers] section.\n
+其它的差别被列在 [link unordered.comparison 与关联式容器的比较] 一节中。

 [endsect]
=======================================
--- /trunk/libs/unordered/doc/rationale.qbk     Mon Dec 28 23:05:14 2009
+++ /trunk/libs/unordered/doc/rationale.qbk     Tue Jul  6 01:48:48 2010
@@ -6,79 +6,102 @@
     [@http://www.concentric.net/~Ttwang/tech/inthash.htm
     Thomas Wang's article on integer hash functions]]

-[section:rationale Implementation Rationale]
+[section:rationale Implementation Rationale 实现原理]

 The intent of this library is to implement the unordered
 containers in the draft standard, so the interface was fixed. But there are
 still some implementation decisions to make. The priorities are
-conformance to the standard and portability.
+conformance to the standard and portability.\n
+本库的目的是实现标准草案中的无序容器,所以库的接口是固定的。不过还是做一些 实现上的决定。首先是与标准的一致性和可移植性。

The [@http://en.wikipedia.org/wiki/Hash_table wikipedia article on hash tables]
-has a good summary of the implementation issues for hash tables in general.
-
-[h2 Data Structure]
+has a good summary of the implementation issues for hash tables in general.\n +[@http://en.wikipedia.org/wiki/Hash_table wikipedia中关于散列表的论文] 上有 关于通常的散列表实现问题的一个很好的总结。
+
+[h2 Data Structure 数据结构]

 By specifying an interface for accessing the buckets of the container the
-standard pretty much requires that the hash table uses chained addressing.
+standard pretty much requires that the hash table uses chained addressing.\n
+通过指定一个接口用于访问容器中的桶,标准几乎就是要求散列表使用链接法。

It would be conceivable to write a hash table that uses another method. For
 example, it could use open addressing, and use the lookup chain to act as a
-bucket but there are a some serious problems with this:
+bucket but there are a some serious problems with this: \n
+可以想象编写使用其它方法的散列表。例如,它可以使用开放法,并使用查找链来作 为桶,不过这样会存在一些严重的问题:

* The draft standard requires that pointers to elements aren't invalidated, so
   the elements can't be stored in one array, but will need a layer of
   indirection instead - losing the efficiency and most of the memory gain,
-  the main advantages of open addressing.
+  the main advantages of open addressing.\n
+ 标准草案要求指向元素的指针不可失效,所以元素不可以被存放在一个数组中,而 是需要一个间接层 -
+  失去了效率和获得的大部分内存,这正是开放地址的主要优势。

 * Local iterators would be very inefficient and may not be able to
-  meet the complexity requirements.
+  meet the complexity requirements.\n
+  局部迭代器将会非常低效,可能无法满足复杂度的要求。

* There are also the restrictions on when iterators can be invalidated. Since open addressing degrades badly when there are a high number of collisions the restrictions could prevent a rehash when it's really needed. The maximum load
   factor could be set to a fairly low value to work around this - but the
-  standard requires that it is initially set to 1.0.
+  standard requires that it is initially set to 1.0.\n
+ 在迭代器可以失效时也会有限制。由于在存在大量冲突时,开放法会严重退化,而 该限制会在需要时阻止重散列。 + 可以通过将最大负载因子设为一个相当低的值来解决这个问题 - 但标准要求最大负 载因子在初始时设为 1.0。

 * And since the standard is written with a eye towards chained
- addressing, users will be surprised if the performance doesn't reflect that.
-
-So chained addressing is used.
+ addressing, users will be surprised if the performance doesn't reflect that.\n + 而且由于标准在编写时是着眼于链接法的,如果最终的性能不能反映这一点,用户 将会非常惊讶。
+
+So chained addressing is used.\n
+所以我们使用了链接法。

For containers with unique keys I store the buckets in a single-linked list.
 There are other possible data structures (such as a double-linked list)
 that allow for some operations to be faster (such as erasing and iteration)
 but the possible gain seems small compared to the extra memory needed.
The most commonly used operations (insertion and lookup) would not be improved
-at all.
+at all.\n
+对于唯一键的容器,我将桶保存在一个单链表中。有一些其它的数据结构(如双链表 )可以使得某些操作更快(如删除和迭代), +不过可能的收益似乎比所需的额外内存开销要小。毕竟最常用的操作(插入和查找)并 没有得到提升。

But for containers with equivalent keys a single-linked list can degrade badly when a large number of elements with equivalent keys are inserted. I think it's
 reasonable to assume that users who choose to use `unordered_multiset` or
 `unordered_multimap` do so because they are likely to insert elements with
 equivalent keys. So I have used an alternative data structure that doesn't
-degrade, at the expense of an extra pointer per node.
+degrade, at the expense of an extra pointer per node.\n
+但对于非唯一键的容器,使用单链表会在插入大量相同键值的元素时性能严重退化。
+我认为,假设选择使用 `unordered_multiset` 或 `unordered_multimap` 的用户将 很可能会插入相等键值的元素,这是很合理的。 +所以我对此种容器使用了另一种性能不会退化的数据结构,其代价是每个节点多用一 个指针。

This works by adding storing a circular linked list for each group of equivalent nodes in reverse order. This allows quick navigation to the end of a group (since the first element points to the last) and can be quickly updated when elements are inserted or erased. The main disadvantage of this approach is some hairy code
-for erasing elements.
-
-[h2 Number of Buckets]
+for erasing elements.\n
+这是通过为每组相等的节点在相反顺序上增加一个循环的链表来实现的。
+这样可以快速地定位到该组节点的末尾(因为第一个元素指向最后一个),并且在插入 或删除元素时也可以快速更新。
+这种方法的主要缺点是删除元素的代码有点不太好看。
+
+[h2 Number of Buckets 桶的数量]

 There are two popular methods for choosing the number of buckets in a hash
 table. One is to have a prime number of buckets, another is to use a power
-of 2.
+of 2.\n
+有两种常见的方法来选择在散列表中的桶的数量。一种是让桶的数量为素数,另一种 是使用2的幂数。

 Using a prime number of buckets, and choosing a bucket by using the modulus
 of the hash function's result will usually give a good result. The downside
-is that the required modulus operation is fairly expensive.
+is that the required modulus operation is fairly expensive.\n
+使用素数个桶,并且通过对散列函数的结果取模来选择桶通常有不错的结果。缺点是 模操作的代价有点高。

 Using a power of 2 allows for much quicker selection of the bucket
 to use, but at the expense of loosing the upper bits of the hash value.
 For some specially designed hash functions it is possible to do this and
 still get a good result but as the containers can take arbitrary hash
-functions this can't be relied on.
+functions this can't be relied on.\n
+使用2的幂则可以更快地选择要用的桶,但是它的代价是损失了散列值的高位信息。
+对于一些特殊设计的散列函数,这样是可以的,并且结果也还不错,但是考虑到容器 可能使用任意的散列函数,所以不能依赖于它。

To avoid this a transformation could be applied to the hash function, for an
 example see __wang__.  Unfortunately, a transformation like Wang's requires
@@ -86,56 +109,76 @@
 This leaves more expensive methods, such as Knuth's Multiplicative Method
(mentioned in Wang's article). These don't tend to work as well as taking the
 modulus of a prime, and the extra computation required might negate
-efficiency advantage of power of 2 hash tables.
-
-So, this implementation uses a prime number for the hash table size.
-
-[h2 Equality operators]
+efficiency advantage of power of 2 hash tables.\n
+为了避免这个问题,可以对散列函数进行一个转换,有关例子请见 __wang__ 关于整 数散列函数的论文。 +不幸,象 Wang 所给出的转换方法要求知道散列值中的二进制位数,所以它的可移植 性不够。
+还有一些更昂贵的方法,如 Knuth 的相乘法(在 Wang 的论文中提及)。
+它们和对素数取模一样不太好用,而且所需的额外计算可能还会消除2的幂的散列表所 带来的性能优势。
+
+So, this implementation uses a prime number for the hash table size.\n
+所以,我们实现使用素数作为散列表的大小。
+
+[h2 Equality operators 相等操作符]

 `operator==` and `operator!=` are not included in the standard, but I've
 added them as I think they could be useful and can be implemented
 fairly efficiently. They are specified differently to the other standard
 containers, comparing keys using the equality predicate rather than
-`operator==`.
+`operator==`.\n
+`operator==` 和 `operator!=` 并没有包含在标准中,不过我把它们加了进来,因为 我认为它们可能是有用的,也可以高效地实现。 +它们与标准关联式容器是非常不同的,对键值的比较是使用等同性谓词而不是 `operator==` 的。

 It's also different to the proposal
 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2944.pdf n2944].
 which uses the equality operators for the whole of `value_type`. This
 implementation just uses the key equality function for the key,
 and `mapped_type`'s equality operator in `unordered_map` and
-`unordered_multimap` for the mapped part of the element.
+`unordered_multimap` for the mapped part of the element.\n
+这与建议书 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2944.pdf n2944] 也不一样。 +在建议书中是对整个 `value_type` 使用相等性操作符。而本实现则只对键值使用相 等性比较函数,在 `unordered_map` +和 `unordered_multimap` 中则对元素中的映射部分使用 `mapped_type` 的相等性操 作符。

Also, in `unordered_multimap`, the mapped values for a group of elements with
 equivalent keys are only considered equal if they are in the same order,
 in n2944 they just need to be a permutation of each other. Since the
order of elements with equal keys is now defined to be stable, it seems to me
-that their order can be considered part of the container's value.
-
-[h2 Active Issues and Proposals]
-
-[h3 C++0x allocators]
+that their order can be considered part of the container's value.\n
+还有,在 `unordered_multimap` 中,带有相等键值的一组元素的映射值被认为是相 等的,如果它们具有相同的顺序,在 n2944 +中它们只需要互为排列即可。由于具有相等键值的元素顺序现在被定义为稳定的,所 以对我来说,它们的顺序可以被认为是容器值的一部分。
+
+[h2 Active Issues and Proposals 活跃的问题与建议]
+
+[h3 C++0x allocators C++0x分配器]

 Recent drafts have included an overhaul of the allocators, but this was
 dependent on concepts which are no longer in the standard.
 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2946.pdf n2946]
 attempts to respecify them without concepts. I'll try to implement this (or
an appropriate later version) in a future version of boost, possibly changed
-a little to accomodate non-C++0x compilers.
-
-[h3 Swapping containers with unequal allocators]
+a little to accomodate non-C++0x compilers.\n
+最新的草案已经包含了对分配器的一个修改,但它是依赖于尚未进入标准的一些概念 的。 +[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2946.pdf n2946] 试图不使用概念来重新实现它们。 +在以后的boost版本中,我会尽力实现它们(或是它们的一个近似版本),也可能有一点 改变,以适应非C++0x标准的编译器。
+
+[h3 Swapping containers with unequal allocators 交换具有不同分配器的容器]

 It isn't clear how to swap containers when their allocators aren't equal.
 This is
 [@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#431
Issue 431: Swapping containers with unequal allocators]. This has been resolved
 with the new allocator specification, so this should be fixed when
-support is added.
-
-[h3 Are insert and erase stable for unordered_multiset and unordered_multimap?]
+support is added.\n
+如果交换具有不同分配器的容器,这一点还不清楚。这正是 [@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#431 +Issue 431: 交换具有不同分配器的容器]。通过新的分配器规范,这个问题已经被解 决,所以当可以支持时就可以修正该问题。
+
+[h3 Are insert and erase stable for unordered_multiset and unordered_multimap?
+对于 unordered_multiset 和 unordered_multimap 来说,插入和删除是稳定的吗?]

It wan't specified if `unordered_multiset` and `unordered_multimap` preserve the order of elements with equivalent keys (i.e. if they're stable under `insert` and `erase`).
 Since [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2691.pdf
-n2691] it's been specified that they do and this implementation follows that. +n2691] it's been specified that they do and this implementation follows that.\n +没有规定 `unordered_multiset` 和 `unordered_multimap` 是否要保持相等键值元 素的顺序(即在 `insert` 和 `erase` 时它们是否稳定)。从 +[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2691.pdf n2691] 起已规定如此,本实现也遵守这一点。

 [endsect]
=======================================
--- /trunk/libs/unordered/doc/ref.xml   Mon May 31 02:08:39 2010
+++ /trunk/libs/unordered/doc/ref.xml   Tue Jul  6 01:48:48 2010
@@ -20,33 +20,44 @@
             </template-type-parameter>
           </template>
           <purpose><simpara>
-            An unordered associative container that stores unique values.
+ An unordered associative container that stores unique values.<sbr/>
+            保存唯一值的无序关联式容器。
           </simpara></purpose>
           <description>
             <para>Based on chapter 23 of
<ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2960.pdf";>the working draft of the C++ standard [n2960]</ulink>.
-              But without the updated rules for allocators.
+              But without the updated rules for allocators.<sbr/>
+ 基于 <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2960.pdf";>C++标 准工作草案[n2690]</ulink>
+              第23章。但不包含对分配器的最新规则。
             </para>
-            <para><emphasis role="bold">Template Parameters</emphasis>
+ <para><emphasis role="bold">Template Parameters 模板参数 </emphasis>
               <informaltable>
                 <tgroup cols="2">
                   <tbody>
                     <row>
                       <entry><emphasis>Value</emphasis></entry>
- <entry>Value must be Assignable and CopyConstructible</entry></row> + <entry>Value must be Assignable and CopyConstructible<sbr/>
+                      Value 必须是可赋值和可复制构造的</entry></row>
                     <row>
                       <entry><emphasis>Hash</emphasis></entry>
- <entry>A unary function object type that acts a hash function for a <code>Value</code>. It takes a single argument of type <code>Value</code> and returns a value of type std::size_t.</entry></row> + <entry>A unary function object type that acts a hash function for a <code>Value</code>. It takes a single argument of type <code>Value</code> and returns a value of type std::size_t.<sbr/> + 一元函数对象类型,用作 <code>Value</code> 的散列函 数。 + 它接受单个类型为 <code>Value</code> 的参数,返回类型 为 std::size_t 的值。</entry></row>
                     <row>
                       <entry><emphasis>Pred</emphasis></entry>
<entry>A binary function object that implements an equivalence relation on values of type <code>Value</code>. A binary function object that induces an equivalence relation on values of type Key. - It takes two arguments of type Key and returns a value of type bool.</entry></row> + It takes two arguments of type Key and returns a value of type bool.<sbr/> + 二元函数对象,实现类型 <code>Value</code> 的等同性 关系。 + 它接受两个类型为 Value 的参数,返回类型为 bool 的 值。</entry></row>
                     <row>
                       <entry><emphasis>Alloc</emphasis></entry>
- <entry>An allocator whose value type is the same as the container's value type.</entry></row></tbody></tgroup></informaltable></para> - <para>The elements are organized into buckets. Keys with the same hash code are stored in the same bucket.</para> - <para>The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash.</para> + <entry>An allocator whose value type is the same as the container's value type.<sbr/> + 分配器,它的值类型与容器的值类型相同。 </entry></row></tbody></tgroup></informaltable></para> + <para>The elements are organized into buckets. Keys with the same hash code are stored in the same bucket.<sbr/> + 容器中的元素存放在多个桶中。具有相同散列码的键存放在同一个桶 中。</para> + <para>The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash.<sbr/> + 桶的数量可以通过调用 insert 自动增加,或者调用 rehash 进行调 整。</para>
           </description>
           <typedef name="key_type">
             <type>Value</type>
@@ -80,44 +91,57 @@
           <typedef name="size_type">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
-              <para>An unsigned integral type.</para>
- <para><type>size_type</type> can represent any non-negative value of <type>difference_type</type>.</para>
+              <para>An unsigned integral type.<sbr/>
+              无符号整数类型。</para>
+ <para><type>size_type</type> can represent any non-negative value of <type>difference_type</type>.<sbr/> + <type>size_type</type> 可以表示 <type>difference_type</type> 的任一非负值。</para>
             </description>
           </typedef>
           <typedef name="difference_type">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
-              <para>A signed integral type.</para>
- <para>Is identical to the difference type of <type>iterator</type> and <type>const_iterator</type>.</para>
+              <para>A signed integral type.<sbr/>
+              有符号整数类型。</para>
+ <para>Is identical to the difference type of <type>iterator</type> and <type>const_iterator</type>.<sbr/> + 与 <type>iterator</type> 和 <type>const_iterator</type> 的距 离类型相同。</para>
             </description>
           </typedef>
           <typedef name="iterator">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
- <para>A constant iterator whose value type is <type>value_type</type>. </para> - <para>The iterator category is at least a forward iterator.</para>
-              <para>Convertible to <type>const_iterator</type>.</para>
+ <para>A constant iterator whose value type is <type>value_type</type>. <sbr/>
+              一个常量迭代器,它的值类型为 <type>value_type</type>。</para>
+ <para>The iterator category is at least a forward iterator.<sbr/>
+              迭代器类别至少为前向迭代器。</para>
+              <para>Convertible to <type>const_iterator</type>.<sbr/>
+              可转换为 <type>const_iterator</type>。</para>
             </description>
           </typedef>
           <typedef name="const_iterator">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
- <para>A constant iterator whose value type is <type>value_type</type>. </para> - <para>The iterator category is at least a forward iterator.</para> + <para>A constant iterator whose value type is <type>value_type</type>. <sbr/>
+              一个常量迭代器,它的值类型为 <type>value_type</type>。</para>
+ <para>The iterator category is at least a forward iterator.<sbr/>
+              迭代器类别至少为前向迭代器。</para>
             </description>
           </typedef>
           <typedef name="local_iterator">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
- <para>An iterator with the same value type, difference type and pointer and reference type as <type>iterator</type>.</para> - <para>A local_iterator object can be used to iterate through a single bucket.</para> + <para>An iterator with the same value type, difference type and pointer and reference type as <type>iterator</type>.<sbr/> + 具有与 <type>iterator</type> 相同值类型、距离类型和指针、引用 类型的迭代器。</para> + <para>A local_iterator object can be used to iterate through a single bucket.<sbr/>
+              local_iterator 对象可用于遍历单个桶。</para>
             </description>
           </typedef>
           <typedef name="const_local_iterator">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
- <para>A constant iterator with the same value type, difference type and pointer and reference type as <type>const_iterator</type>.</para> - <para>A const_local_iterator object can be used to iterate through a single bucket.</para> + <para>A constant iterator with the same value type, difference type and pointer and reference type as <type>const_iterator</type>.<sbr/> + 具有与 <type>const_iterator</type> 相同值类型、距离类型和指 针、引用类型的迭代器。</para> + <para>A const_local_iterator object can be used to iterate through a single bucket.<sbr/>
+              const_local_iterator 对象可用于遍历单个桶。</para>
             </description>
           </typedef>
           <constructor specifiers="explicit">
@@ -141,7 +165,8 @@
               <code><methodname>size</methodname>() == 0</code>
             </postconditions>
             <description>
- <para>Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0.</para> + <para>Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0.<sbr/> + 构造一个带至少 n 个桶的空容器,以 hf 作为散列函数,eq 作为键 值等同性谓词,a 作为分配器,最大负载因子为 1.0。</para>
             </description>
           </constructor>
           <constructor>
@@ -172,7 +197,8 @@
               <default>allocator_type()</default>
             </parameter>
             <description>
- <para>Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.</para> + <para>Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.<sbr/> + 构造一个带至少 n 个桶的空容器,以 hf 作为散列函数,eq 作为键 值等同性谓词,a 作为分配器,最大负载因子为 1.0,并插入 [f,l) 的元素。</para>
             </description>
           </constructor>
           <constructor>
@@ -180,10 +206,12 @@
               <paramtype>unordered_set const&amp;</paramtype>
             </parameter>
             <description>
- <para>The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.</para> + <para>The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.<sbr/> + 复制构造函数。复制所含的元素、散列函数、谓词、最大负载因子和 分配器。</para>
             </description>
             <requires>
-              <para><code>value_type</code> is copy constructible</para>
+              <para><code>value_type</code> is copy constructible<sbr/>
+              <code>value_type</code> 为可复制构造的</para>
             </requires>
           </constructor>
           <constructor>
@@ -191,15 +219,18 @@
               <paramtype>unordered_set &amp;&amp;</paramtype>
             </parameter>
             <description>
-              <para>The move constructor.</para>
+              <para>The move constructor.<sbr/>
+              移动构造函数。</para>
             </description>
             <notes>
- <para>This is emulated on compilers without rvalue references.</para> + <para>This is emulated on compilers without rvalue references.<sbr/>
+              在不带右值引用的编译器上的模拟。</para>
             </notes>
             <requires>
               <para>
                 <code>value_type</code> is move constructible.
- (TODO: This is not actually required in this implementation). + (TODO: This is not actually required in this implementation).<sbr/> + <code>value_type</code> 是可移动构造的。(待办:在本实现中并 不真正要求)。
               </para>
             </requires>
           </constructor>
@@ -208,7 +239,8 @@
               <paramtype>Allocator const&amp;</paramtype>
             </parameter>
             <description>
- <para>Constructs an empty container, using allocator <code>a</code>.</para> + <para>Constructs an empty container, using allocator <code>a</code>.<sbr/>
+                构造一个空容器,使用分配器 <code>a</code>。</para>
             </description>
           </constructor>
           <constructor>
@@ -219,12 +251,14 @@
               <paramtype>Allocator const&amp;</paramtype>
             </parameter>
             <description>
- <para>Constructs an container, copying <code>x</code>'s contained elements, hash function, predicate, maximum load factor, but using allocator <code>a</code>.</para> + <para>Constructs an container, copying <code>x</code>'s contained elements, hash function, predicate, maximum load factor, but using allocator <code>a</code>.<sbr/> + 构造一个容器,复制 <code>x</code> 所含的元素、散列函数、谓 词、最大负载因子,但使用分配器 <code>a</code>。</para>
             </description>
           </constructor>
           <destructor>
             <notes>
- <para>The destructor is applied to every element, and all memory is deallocated</para> + <para>The destructor is applied to every element, and all memory is deallocated<sbr/>
+              对每个元素调用构造函数,并释放所有内存。</para>
             </notes>
           </destructor>
           <method name="operator=">
@@ -233,17 +267,20 @@
             </parameter>
             <type>unordered_set&amp;</type>
             <description>
- <para>The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.</para> + <para>The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.<sbr/> + 赋值操作符。复制所含的元素、散列函数、谓词、最大负载因子,但 不复制分配器。</para>
             </description>
             <notes>
               <para>
On compilers without rvalue references, there is a single assignment operator with the signature <code>operator=(unordered_set)</code>
-                in order to emulate move semantics.
+                in order to emulate move semantics.<sbr/>
+ 在没有右值引用的编译器上,有一个署名为 <code>operator=(unordered_set)</code> 的赋值操作符,用于模拟移动语义。
               </para>
             </notes>
             <requires>
-              <para><code>value_type</code> is copy constructible</para>
+              <para><code>value_type</code> is copy constructible<sbr/>
+              <code>value_type</code> 为可复制构造的</para>
             </requires>
           </method>
           <method name="operator=">
@@ -252,19 +289,22 @@
             </parameter>
             <type>unordered_set&amp;</type>
             <description>
-              <para>The move assignment operator.</para>
+              <para>The move assignment operator.<sbr/>
+              移动赋值操作符。</para>
             </description>
             <notes>
               <para>
On compilers without rvalue references, there is a single assignment operator with the signature <code>operator=(unordered_set)</code>
-                in order to emulate move semantics.
+                in order to emulate move semantics.<sbr/>
+ 在没有右值引用的编译器上,有一个署名为 <code>operator=(unordered_set)</code> 的赋值操作符,用于模拟移动语义。
               </para>
             </notes>
             <requires>
               <para>
                 <code>value_type</code> is move constructible.
- (TODO: This is not actually required in this implementation). + (TODO: This is not actually required in this implementation).<sbr/> + <code>value_type</code> 是可移动构造的。(待办:在本实现中并 不真正要求)。
               </para>
             </requires>
           </method>
@@ -286,7 +326,8 @@
             </method>
             <method name="max_size" cv="const">
               <type>size_type</type>
- <returns><code><methodname>size</methodname>()</code> of the largest possible container. + <returns><code><methodname>size</methodname>()</code> of the largest possible container.<sbr/>
+              最大可能容器的 <code><methodname>size</methodname>()</code>。
               </returns>
             </method>
           </method-group>
@@ -294,7 +335,8 @@
             <overloaded-method name="begin">
               <signature><type>iterator</type></signature>
               <signature cv="const"><type>const_iterator</type></signature>
- <returns>An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + <returns>An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container.<sbr/> + 一个迭代器,引向容器的第一个元素,或者如果容器为空,引向容器 的 past-the-end 值。
               </returns>
             </overloaded-method>
             <overloaded-method name="end">
@@ -304,17 +346,20 @@
               <signature cv="const">
                 <type>const_iterator</type>
               </signature>
- <returns>An iterator which refers to the past-the-end value for the container. + <returns>An iterator which refers to the past-the-end value for the container.<sbr/>
+              一个迭代器,引向容器的 past-the-end 值。
               </returns>
             </overloaded-method>
             <method name="cbegin" cv="const">
               <type>const_iterator</type>
- <returns>A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. + <returns>A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container.<sbr/> + 一个常量迭代器,引向容器的第一个元素,或者如果容器为空,引向 容器的 past-the-end 值。
               </returns>
             </method>
             <method name="cend" cv="const">
               <type>const_iterator</type>
- <returns>A constant iterator which refers to the past-the-end value for the container. + <returns>A constant iterator which refers to the past-the-end value for the container.<sbr/>
+              一个常量迭代器,引向容器的 past-the-end 值。
               </returns>
             </method>
           </method-group>
@@ -329,21 +374,28 @@
               </parameter>
               <type>std::pair&lt;iterator, bool&gt;</type>
               <description>
- <para>Inserts an object, constructed with the arguments <code>args</code>, in the container if and only if there is no element in the container with an equivalent value.</para> + <para>Inserts an object, constructed with the arguments <code>args</code>, in the container if and only if there is no element in the container with an equivalent value.<sbr/> + 插入一个从参数 <code>args</code> 构造的对象到容器中,当且仅 当空器中没有相同键值的元素。</para>
               </description>
               <returns>
- <para>The bool component of the return type is true if an insert took place.</para> - <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.</para> + <para>The bool component of the return type is true if an insert took place.<sbr/>
+                如果插入成功,则返回类型的 bool 部分为 true。</para>
+ <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.<sbr/> + 如果插入成功,则迭代器指向新插入的元素。否则,指向具有相同 键值的元素。</para>
               </returns>
               <throws>
- <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para> + <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.<sbr/> + 如果从对 <code>hasher</code> 的调用以外抛出异常,该函数没有 作用。</para>
               </throws>
               <notes>
- <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para> - <para>Pointers and references to elements are never invalidated.</para> + <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.<sbr/> + 可能使迭代器失效,但仅当插入操作导致负载因子大于或等于最大 负载因子时。</para> + <para>Pointers and references to elements are never invalidated.<sbr/>
+                指向元素的指针和引用不会失效。</para>
<para>If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support
-                      for rvalue references or move semantics.</para>
+                      for rvalue references or move semantics.<sbr/>
+ 如果编译器不支持可变数量模板参数或右值引用,则模拟至 最多10个参数,且不支持右值引用或转移语义。</para>
               </notes>
             </method>
             <method name="emplace_hint">
@@ -359,22 +411,31 @@
               </parameter>
               <type>iterator</type>
               <description>
- <para>Inserts an object, constructed with the arguments <code>args</code>, in the container if and only if there is no element in the container with an equivalent value.</para> - <para>hint is a suggestion to where the element should be inserted.</para> + <para>Inserts an object, constructed with the arguments <code>args</code>, in the container if and only if there is no element in the container with an equivalent value.<sbr/> + 插入一个从参数 <code>args</code> 构造的对象到容器中,当且仅 当空器中没有相同键值的元素。</para> + <para>hint is a suggestion to where the element should be inserted.<sbr/>
+                hint 是一个插入元素的建议点。</para>
               </description>
               <returns>
- <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.</para> + <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.<sbr/> + 如果插入成功,则迭代器指向新插入的元素。否则,指向具有相同 键值的元素。</para>
               </returns>
               <throws>
- <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para> + <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.<sbr/> + 如果从对 <code>hasher</code> 的调用以外抛出异常,该函数没有 作用。</para>
               </throws>
               <notes>
- <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. </para> - <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para> - <para>Pointers and references to elements are never invalidated.</para> + <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. <sbr/> + 标准对于提示的意义相当含糊。不过使用它的唯一可行的方法,也 是 Boost.Unordered
+                支持的唯一方法是,指向具有相同值的元素。</para>
+ <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.<sbr/> + 可能使迭代器失效,但仅当插入操作导致负载因子大于或等于最大 负载因子时。</para> + <para>Pointers and references to elements are never invalidated.<sbr/>
+                指向元素的指针和引用不会失效。</para>
<para>If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support
-                      for rvalue references or move semantics.</para>
+                      for rvalue references or move semantics.<sbr/>
+ 如果编译器不支持可变数量模板参数或右值引用,则模拟至 最多10个参数,且不支持右值引用或转移语义。</para>
               </notes>
             </method>
             <method name="insert">
@@ -383,18 +444,24 @@
               </parameter>
               <type>std::pair&lt;iterator, bool&gt;</type>
               <description>
- <para>Inserts obj in the container if and only if there is no element in the container with an equivalent value.</para> + <para>Inserts obj in the container if and only if there is no element in the container with an equivalent value.<sbr/> + 插入 obj 到容器中,当且仅当空器中没有相同键值的元素。 </para>
               </description>
               <returns>
- <para>The bool component of the return type is true if an insert took place.</para> - <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.</para> + <para>The bool component of the return type is true if an insert took place.<sbr/>
+                如果插入成功,则返回类型的 bool 部分为 true。</para>
+ <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.<sbr/> + 如果插入成功,则迭代器指向新插入的元素。否则,指向具有相同 键值的元素。</para>
               </returns>
               <throws>
- <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para> + <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.<sbr/> + 如果从对 <code>hasher</code> 的调用以外抛出异常,该函数没有 作用。</para>
               </throws>
               <notes>
- <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para> - <para>Pointers and references to elements are never invalidated.</para> + <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.<sbr/> + 可能使迭代器失效,但仅当插入操作导致负载因子大于或等于最大 负载因子时。</para> + <para>Pointers and references to elements are never invalidated.<sbr/>
+                指向元素的指针和引用不会失效。</para>
               </notes>
             </method>
             <method name="insert">
@@ -406,19 +473,27 @@
               </parameter>
               <type>iterator</type>
               <description>
- <para>Inserts obj in the container if and only if there is no element in the container with an equivalent value.</para> - <para>hint is a suggestion to where the element should be inserted.</para> + <para>Inserts obj in the container if and only if there is no element in the container with an equivalent value.<sbr/> + 插入 obj 到容器中,当且仅当空器中没有相同键值的元素。 </para> + <para>hint is a suggestion to where the element should be inserted.<sbr/>
+                hint 是一个插入元素的建议点。</para>
               </description>
               <returns>
- <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.</para> + <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.<sbr/> + 如果插入成功,则迭代器指向新插入的元素。否则,指向具有相同 键值的元素。</para>
               </returns>
               <throws>
- <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para> + <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.<sbr/> + 如果从对 <code>hasher</code> 的调用以外抛出异常,该函数没有 作用。</para>
               </throws>
               <notes>
- <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. </para> - <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para> - <para>Pointers and references to elements are never invalidated.</para> + <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. <sbr/> + 标准对于提示的意义相当含糊。不过使用它的唯一可行的方法,也 是 Boost.Unordered
+                支持的唯一方法是,指向具有相同值的元素。</para>
+ <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.<sbr/> + 可能使迭代器失效,但仅当插入操作导致负载因子大于或等于最大 负载因子时。</para> + <para>Pointers and references to elements are never invalidated.<sbr/>
+                指向元素的指针和引用不会失效。</para>
               </notes>
             </method>
             <method name="insert">
@@ -434,14 +509,18 @@
               </parameter>
               <type>void</type>
               <description>
- <para>Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent value.</para> + <para>Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent value.<sbr/> + 插入一组元素到容器中。元素当且仅当空器中没有相同键值的元素 时被插入。</para>
               </description>
               <throws>
- <para>When inserting a single element, if an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para> + <para>When inserting a single element, if an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.<sbr/> + 当插入单个元素时,如果从对 <code>hasher</code> 的调用以外抛 出异常,该函数没有作用。</para>
               </throws>
               <notes>
- <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para> - <para>Pointers and references to elements are never invalidated.</para> + <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.<sbr/> + 可能使迭代器失效,但仅当插入操作导致负载因子大于或等于最大 负载因子时。</para> + <para>Pointers and references to elements are never invalidated.<sbr/>
+                指向元素的指针和引用不会失效。</para>
               </notes>
             </method>
             <method name="erase">
@@ -450,14 +529,18 @@
               </parameter>
               <type>iterator</type>
               <description>
- <para>Erase the element pointed to by <code>position</code>.</para> + <para>Erase the element pointed to by <code>position</code>.<sbr/>
+                删除 <code>position</code> 所指元素。</para>
               </description>
               <returns>
- <para>The iterator following <code>position</code> before the erasure.</para> + <para>The iterator following <code>position</code> before the erasure.<sbr/>
+                在删除前紧跟 <code>position</code> 的迭代器。</para>
               </returns>
               <throws>
- <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para> - <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para> + <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.<sbr/> + 仅当从 <code>hasher</code> 或 <code>key_equal</code> 抛出异 常时抛出该异常。</para> + <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.<sbr/> + 在该实现中,这一重载不会调用函数对象方法,所以它不会抛 出,不过在其它实现中不一定也是如此。</para>
               </throws>
               <notes>
                 <para>
@@ -465,7 +548,9 @@
this function can be very inefficient as it has to search through empty buckets for the next element, in order to return the iterator. The method <methodname>quick_erase</methodname> is faster, but has yet
-                  to be standardized.
+                  to be standardized.<sbr/>
+ 当元素的数量远小于桶的数量时,这个函数会非常低效,因为它 必须对空桶搜索下一个元素以返回该迭代器。 + 方法 <methodname>quick_erase</methodname> 会更快一些,但 尚未标准化。
                 </para>
               </notes>
             </method>
@@ -475,13 +560,16 @@
               </parameter>
               <type>size_type</type>
               <description>
- <para>Erase all elements with key equivalent to <code>k</code>.</para> + <para>Erase all elements with key equivalent to <code>k</code>.<sbr/>
+                删除所有键值等于 <code>k</code> 的元素。</para>
               </description>
               <returns>
-                <para>The number of elements erased.</para>
+                <para>The number of elements erased.<sbr/>
+                被删除的元素数量。</para>
               </returns>
               <throws>
- <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para> + <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.<sbr/> + 仅当从 <code>hasher</code> 或 <code>key_equal</code> 抛出异 常时抛出该异常。</para>
               </throws>
             </method>
             <method name="erase">
@@ -493,14 +581,18 @@
               </parameter>
               <type>iterator</type>
               <description>
- <para>Erases the elements in the range from <code>first</code> to <code>last</code>.</para> + <para>Erases the elements in the range from <code>first</code> to <code>last</code>.<sbr/> + 删除从 <code>first</code> 到 <code>last</code> 的元素。 </para>
               </description>
               <returns>
- <para>The iterator following the erased elements - i.e. <code>last</code>.</para> + <para>The iterator following the erased elements - i.e. <code>last</code>.<sbr/>
+                紧随被删除元素之后的迭代器 - 即 <code>last</code>。</para>
               </returns>
               <throws>
- <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para> - <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para> + <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.<sbr/> + 仅当从 <code>hasher</code> 或 <code>key_equal</code> 抛出异 常时抛出该异常。</para> + <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.<sbr/> + 在该实现中,这一重载不会调用函数对象方法,所以它不会抛 出,不过在其它实现中不一定也是如此。</para>
               </throws>
             </method>
             <method name="quick_erase">
@@ -509,21 +601,26 @@
               </parameter>
               <type>void</type>
               <description>
- <para>Erase the element pointed to by <code>position</code>.</para> + <para>Erase the element pointed to by <code>position</code>.<sbr/>
+                删除 <code>position</code> 所指元素。</para>
               </description>
               <throws>
- <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para> - <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para> + <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.<sbr/> + 仅当从 <code>hasher</code> 或 <code>key_equal</code> 抛出异 常时抛出该异常。</para> + <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.<sbr/> + 在该实现中,这一重载不会调用函数对象方法,所以它不会抛 出,不过在其它实现中不一定也是如此。</para>
               </throws>
               <notes>
                 <para>
This method is faster than <methodname>erase</methodname> as it doesn't have to find the next element in the container -
-                  a potentially costly operation.
+                  a potentially costly operation.<sbr/>
+ 这个方法快于 <methodname>erase</methodname>,因为它不需要 在容器中查找下一个元素 - 这种查找可能很耗时间。
                 </para>
                 <para>
                   As it hasn't been standardized, it's likely that this may
-                  change in the future.
+                  change in the future.<sbr/>
+                  由于该方法未被标准化,它可能会在以后有所变化。
                 </para>
               </notes>
             </method>
@@ -533,31 +630,37 @@
               </parameter>
               <type>void</type>
               <description>
- <para>Erase the element pointed to by <code>position</code>.</para> + <para>Erase the element pointed to by <code>position</code>.<sbr/>
+                删除 <code>position</code> 所指元素。</para>
               </description>
               <throws>
- <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para> - <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para> + <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.<sbr/> + 仅当从 <code>hasher</code> 或 <code>key_equal</code> 抛出异 常时抛出该异常。</para> + <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.<sbr/> + 在该实现中,这一重载不会调用函数对象方法,所以它不会抛 出,不过在其它实现中不一定也是如此。</para>
               </throws>
               <notes>
                 <para>
                   This method is now deprecated, use
<methodname>quick_return</methodname> instead. Although be
                   warned that as that isn't standardized yet, it could also
-                  change.
+                  change.<sbr/>
+ 该方法现在已不再使用,请用 <methodname>quick_return</methodname> 替代。不过这尚未标准化,可能会变。
                 </para>
               </notes>
             </method>
             <method name="clear">
               <type>void</type>
               <description>
-                <para>Erases all elements in the container.</para>
+                <para>Erases all elements in the container.<sbr/>
+                删除容器中所有元素。</para>
               </description>
               <postconditions>
<para><code><methodname>size</methodname>() == 0</code></para>
               </postconditions>
               <throws>
-                <para>Never throws an exception.</para>
+                <para>Never throws an exception.<sbr/>
+                不会抛出。</para>
               </throws>
             </method>
             <method name="swap">
@@ -566,23 +669,28 @@
               </parameter>
               <type>void</type>
               <throws>
- <para>If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of <code>key_equal</code> or <code>hasher</code>.</para> + <para>If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of <code>key_equal</code> or <code>hasher</code>.<sbr/> + 如果分配器是相同的,则不会抛出,除非异常是从 <code>key_equal</code> 或 + <code>hasher</code> 的复制构造函数或复制赋值操作符抛出的。 </para>
               </throws>
               <notes>
<para>For a discussion of the behavior when allocators aren't equal see - <link linkend="unordered.rationale.swapping_containers_with_unequal_allocators">the implementation details</link>.</para> + <link linkend="unordered.rationale.swapping_containers_with_unequal_allocators">the implementation details</link>.<sbr/> + 有关分配器不同时的行为的讨论,请见 <link linkend="unordered.rationale.swapping_containers_with_unequal_allocators">实 现细节</link>。</para>
               </notes>
             </method>
           </method-group>
           <method-group name="observers">
             <method name="hash_function" cv="const">
               <type>hasher</type>
-              <returns>The container's hash function.
+              <returns>The container's hash function.<sbr/>
+              容器的散列函数。
               </returns>
             </method>
             <method name="key_eq" cv="const">
               <type>key_equal</type>
-              <returns>The container's key equality predicate.
+              <returns>The container's key equality predicate.<sbr/>
+              容器的键值等同性谓词。
               </returns>
             </method>
           </method-group>
@@ -635,13 +743,16 @@
                 <type>const_iterator</type>
               </signature>
               <returns>
- <para>An iterator pointing to an element with key equivalent to <code>k</code>, or <code>b.end()</code> if no such element exists.</para> + <para>An iterator pointing to an element with key equivalent to <code>k</code>, or <code>b.end()</code> if no such element exists.<sbr/> + 一个迭代器,指向键值等于 <code>k</code> 的元素,如果该元素 不存在,返回 <code>b.end()</code>。</para>
               </returns>
               <notes><para>
                 The templated overloads are a non-standard extensions which
                 allows you to use a compatible hash function and equality
                 predicate for a key of a different type in order to avoid
- an expensive type cast. In general, its use is not encouraged. + an expensive type cast. In general, its use is not encouraged.<sbr/> + 这个模板化的重载是非标准化的扩展,使得你可以对不同类型的键 使用兼容的散列函数和相等性谓词,
+                以避免昂贵的类型转换。通常,并不鼓励使用。
               </para></notes>
             </overloaded-method>
             <method name="count" cv="const">
@@ -650,7 +761,8 @@
               </parameter>
               <type>size_type</type>
               <returns>
- <para>The number of elements with key equivalent to <code>k</code>.</para> + <para>The number of elements with key equivalent to <code>k</code>.<sbr/>
+                键值等于 <code>k</code> 的元素数量。</para>
               </returns>
             </method>
             <overloaded-method name="equal_range">
@@ -669,6 +781,8 @@
               <returns>
<para>A range containing all elements with key equivalent to <code>k</code>. If the container doesn't container any such elements, returns + <code><functionname>std::make_pair</functionname>(<methodname>b.end</methodname>(),<methodname>b.end</methodname>())</code>.<sbr/> + 包含所有键值等于 <code>k</code> 的元素的区间。如果容器中 没有这样的元素,返回 <code><functionname>std::make_pair</functionname>(<methodname>b.end</methodname>(),<methodname>b.end</methodname>())</code>.
                   </para>
               </returns>
@@ -678,13 +792,15 @@
             <method name="bucket_count" cv="const">
               <type>size_type</type>
               <returns>
-                <para>The number of buckets.</para>
+                <para>The number of buckets.<sbr/>
+                桶的数量。</para>
               </returns>
             </method>
             <method name="max_bucket_count" cv="const">
               <type>size_type</type>
               <returns>
-                <para>An upper bound on the number of buckets.</para>
+                <para>An upper bound on the number of buckets.<sbr/>
+                桶数量的上限。</para>
               </returns>
             </method>
             <method name="bucket_size" cv="const">
@@ -696,7 +812,8 @@
<para><code>n &lt; <methodname>bucket_count</methodname>()</code></para>
               </requires>
               <returns>
- <para>The number of elements in bucket <code>n</code>.</para> + <para>The number of elements in bucket <code>n</code>.<sbr/>
+                桶 <code>n</code> 中的元素数量。</para>
               </returns>
             </method>
             <method name="bucket" cv="const">
@@ -705,10 +822,12 @@
               </parameter>
               <type>size_type</type>
               <returns>
- <para>The index of the bucket which would contain an element with key <code>k</code>.</para> + <para>The index of the bucket which would contain an element with key <code>k</code>.<sbr/>
+                包含键值为 <code>k</code> 的元素的桶的索引。</para>
               </returns>
               <postconditions>
- <para>The return value is less than <code>bucket_count()</code></para> + <para>The return value is less than <code>bucket_count()</code><sbr/>
+                返回值小于 <code>bucket_count()</code></para>
               </postconditions>
             </method>
             <overloaded-method name="begin">
@@ -725,10 +844,12 @@
                 <type>const_local_iterator</type>
               </signature>
               <requires>
- <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para> + <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.<sbr/> + <code>n</code> 应位于区间 <code>[0, bucket_count())</code>.</para>
               </requires>
               <returns>
- <para>A local iterator pointing the first element in the bucket with index <code>n</code>.</para> + <para>A local iterator pointing the first element in the bucket with index <code>n</code>.<sbr/> + 一个局部迭代器,指向索引为 <code>n</code> 的桶中的第一个元 素。</para>
               </returns>
             </overloaded-method>
             <overloaded-method name="end">
@@ -745,10 +866,12 @@
                 <type>const_local_iterator</type>
               </signature>
               <requires>
- <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para> + <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.<sbr/> + <code>n</code> 应位于区间 <code>[0, bucket_count())</code>.</para>
               </requires>
               <returns>
- <para>A local iterator pointing the 'one past the end' element in the bucket with index <code>n</code>.</para> + <para>A local iterator pointing the 'one past the end' element in the bucket with index <code>n</code>.<sbr/> + 一个局部迭代器,指向索引为 <code>n</code> 的桶中的最后一个 元素之后。</para>
               </returns>
             </overloaded-method>
             <method name="cbegin" cv="const">
@@ -757,10 +880,12 @@
               </parameter>
               <type>const_local_iterator</type>
               <requires>
- <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para> + <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.<sbr/> + <code>n</code> 应位于区间 <code>[0, bucket_count())</code>.</para>
               </requires>
               <returns>
- <para>A constant local iterator pointing the first element in the bucket with index <code>n</code>.</para> + <para>A constant local iterator pointing the first element in the bucket with index <code>n</code>.<sbr/> + 一个常量局部迭代器,指向索引为 <code>n</code> 的桶中的第一 个元素。</para>
               </returns>
             </method>
             <method name="cend">
@@ -769,10 +894,12 @@
               </parameter>
               <type>const_local_iterator</type>
               <requires>
- <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para> + <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.<sbr/> + <code>n</code> 应位于区间 <code>[0, bucket_count())</code>.</para>
               </requires>
               <returns>
- <para>A constant local iterator pointing the 'one past the end' element in the bucket with index <code>n</code>.</para> + <para>A constant local iterator pointing the 'one past the end' element in the bucket with index <code>n</code>.<sbr/> + 一个常量局部迭代器,指向索引为 <code>n</code> 的桶中的最后 一个元素之后。</para>
               </returns>
             </method>
           </method-group>
@@ -780,13 +907,15 @@
             <method name="load_factor" cv="const">
               <type>float</type>
               <returns>
-                <para>The average number of elements per bucket.</para>
+                <para>The average number of elements per bucket.<sbr/>
+                每个桶中元素的平均数量。</para>
               </returns>
             </method>
             <method name="max_load_factor" cv="const">
               <type>float</type>
               <returns>
-                <para>Returns the current maximum load factor.</para>
+                <para>Returns the current maximum load factor.<sbr/>
+                返回当前的最大负载因子。</para>
               </returns>
             </method>
             <method name="max_load_factor">
@@ -795,7 +924,8 @@
               </parameter>
               <type>void</type>
               <effects>
- <para>Changes the container's maximum load factor, using <code>z</code> as a hint.</para> + <para>Changes the container's maximum load factor, using <code>z</code> as a hint.<sbr/>
+                修改容器的最大负载因子,以 <code>z</code> 为提示。</para>
               </effects>
             </method>
             <method name="rehash">
@@ -804,11 +934,14 @@
               </parameter>
               <type>void</type>
               <description>
- <para>Changes the number of buckets so that there at least <code>n</code> buckets, and so that the load factor is less than the maximum load factor.</para> - <para>Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.</para> + <para>Changes the number of buckets so that there at least <code>n</code> buckets, and so that the load factor is less than the maximum load factor.<sbr/> + 修改桶的数量,使得最少有 <code>n</code> 个桶,且负载因子小 于最大负载因子。</para> + <para>Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.<sbr/> + 使迭代器失效,并会改变元素的顺序。指向元素的指针和引用不会 失效。</para>
               </description>
               <throws>
- <para>The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.</para> + <para>The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.<sbr/> + 如果抛出异常,则该函数没有作用,除非异常是从容器的散列函数 或比较函数中抛出的。</para>
               </throws>
             </method>
           </method-group>
@@ -832,9 +965,11 @@
               </parameter>
               <type>bool</type>
               <notes>
-                <para>This is a boost extension.</para>
+                <para>This is a boost extension.<sbr/>
+                这是 boost 的扩展。</para>
<para>Behavior is undefined if the two containers don't have
-                    equivalent equality predicates.</para>
+                    equivalent equality predicates.<sbr/>
+ 如果两个容器不具有等效的相等性谓词,则行为未定义。 </para>
               </notes>
             </function>
             <function name="operator!=">
@@ -856,9 +991,11 @@
               </parameter>
               <type>bool</type>
               <notes>
-                <para>This is a boost extension.</para>
+                <para>This is a boost extension.<sbr/>
+                这是 boost 的扩展。</para>
<para>Behavior is undefined if the two containers don't have
-                    equivalent equality predicates.</para>
+                    equivalent equality predicates.<sbr/>
+ 如果两个容器不具有等效的相等性谓词,则行为未定义。 </para>
               </notes>
             </function>
           </free-function-group>
@@ -885,11 +1022,15 @@
                 <para><code>x.swap(y)</code></para>
               </effects>
               <throws>
- <para>If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of <code>Hash</code> or <code>Pred</code>.</para> + <para>If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of <code>Hash</code> or <code>Pred</code>.<sbr/> + 如果分配器是相同的,则不会抛出异常,除非异常是从 <code>Hash</code> 或 + <code>Pred</code> 的复制构造函数或复制赋值操作符抛出的。 </para>
               </throws>
               <notes>
<para>For a discussion of the behavior when allocators aren't equal see - <link linkend="unordered.rationale.swapping_containers_with_unequal_allocators">the implementation details</link>.</para> + <link linkend="unordered.rationale.swapping_containers_with_unequal_allocators">the implementation details</link>.<sbr/>
+                  有关分配器不同时的行为的讨论,请见
+ <link linkend="unordered.rationale.swapping_containers_with_unequal_allocators">实 现细节</link>。</para>
               </notes>
             </function>
           </free-function-group>
@@ -909,33 +1050,44 @@
             </template-type-parameter>
           </template>
           <purpose><simpara>
- An unordered associative container that stores values. The same key can be stored multiple times. + An unordered associative container that stores values. The same key can be stored multiple times.<sbr/>
+            保存值的无序关联式容器,相同的键值可以保存多次。
           </simpara></purpose>
           <description>
             <para>Based on chapter 23 of
<ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2960.pdf";>the working draft of the C++ standard [n2960]</ulink>.
-              But without the updated rules for allocators.
+              But without the updated rules for allocators.<sbr/>
+ 基于 <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2960.pdf";>C++标 准工作草案[n2690]</ulink>
+              第23章。但不包含对分配器的最新规则。
             </para>
-            <para><emphasis role="bold">Template Parameters</emphasis>
+ <para><emphasis role="bold">Template Parameters 模板参数 </emphasis>
               <informaltable>
                 <tgroup cols="2">
                   <tbody>
                     <row>
                       <entry><emphasis>Value</emphasis></entry>
- <entry>Value must be Assignable and CopyConstructible</entry></row> + <entry>Value must be Assignable and CopyConstructible<sbr/>
+                      Value 必须是可赋值和可复制构造的</entry></row>
                     <row>
                       <entry><emphasis>Hash</emphasis></entry>
- <entry>A unary function object type that acts a hash function for a <code>Value</code>. It takes a single argument of type <code>Value</code> and returns a value of type std::size_t.</entry></row> + <entry>A unary function object type that acts a hash function for a <code>Value</code>. It takes a single argument of type <code>Value</code> and returns a value of type std::size_t.<sbr/> + 一元函数对象类型,用作 <code>Value</code> 的散列函 数。它接受单个类型为 <code>Value</code>
+                      的参数,返回类型为 std::size_t 的值。</entry></row>
                     <row>
                       <entry><emphasis>Pred</emphasis></entry>
<entry>A binary function object that implements an equivalence relation on values of type <code>Value</code>. A binary function object that induces an equivalence relation on values of type Key. - It takes two arguments of type Key and returns a value of type bool.</entry></row> + It takes two arguments of type Key and returns a value of type bool.<sbr/> + 二元函数对象,实现类型 <code>Value</code> 的等同性 关系。 + 它接受两个类型为 Value 的参数,返回类型为 bool 的 值。</entry></row>
                     <row>
                       <entry><emphasis>Alloc</emphasis></entry>
- <entry>An allocator whose value type is the same as the container's value type.</entry></row></tbody></tgroup></informaltable></para> - <para>The elements are organized into buckets. Keys with the same hash code are stored in the same bucket and elements with equivalent keys are stored next to each other.</para> - <para>The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash.</para> + <entry>An allocator whose value type is the same as the container's value type.<sbr/> + 分配器,它的值类型与容器的值类型相同。 </entry></row></tbody></tgroup></informaltable></para> + <para>The elements are organized into buckets. Keys with the same hash code are stored in the same bucket and elements with equivalent keys are stored next to each other.<sbr/> + 容器中的元素存放在多个桶中。具有相同散列码的键存放在同一个桶 中,相同键值的元素会连续存放在一起。</para> + <para>The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash.<sbr/> + 桶的数量可以通过调用 insert 自动增加,或者调用 rehash 进行调 整。</para>
           </description>
           <typedef name="key_type">
             <type>Value</type>
@@ -969,44 +1121,57 @@
           <typedef name="size_type">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
-              <para>An unsigned integral type.</para>
- <para><type>size_type</type> can represent any non-negative value of <type>difference_type</type>.</para>
+              <para>An unsigned integral type.<sbr/>
+              无符号整数类型。</para>
+ <para><type>size_type</type> can represent any non-negative value of <type>difference_type</type>.<sbr/> + <type>size_type</type> 可以表示 <type>difference_type</type> 的任一非负值。</para>
             </description>
           </typedef>
           <typedef name="difference_type">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
-              <para>A signed integral type.</para>
- <para>Is identical to the difference type of <type>iterator</type> and <type>const_iterator</type>.</para>
+              <para>A signed integral type.<sbr/>
+              有符号整数类型。</para>
+ <para>Is identical to the difference type of <type>iterator</type> and <type>const_iterator</type>.<sbr/> + 与 <type>iterator</type> 和 <type>const_iterator</type> 的距 离类型相同。</para>
             </description>
           </typedef>
           <typedef name="iterator">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
- <para>A constant iterator whose value type is <type>value_type</type>. </para> - <para>The iterator category is at least a forward iterator.</para>
-              <para>Convertible to <type>const_iterator</type>.</para>
+ <para>A constant iterator whose value type is <type>value_type</type>. <sbr/>
+              一个常量迭代器,它的值类型为 <type>value_type</type>。</para>
+ <para>The iterator category is at least a forward iterator.<sbr/>
+              迭代器类别至少为前向迭代器。</para>
+              <para>Convertible to <type>const_iterator</type>.<sbr/>
+              可转换为 <type>const_iterator</type>。</para>
             </description>
           </typedef>
           <typedef name="const_iterator">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
- <para>A constant iterator whose value type is <type>value_type</type>. </para> - <para>The iterator category is at least a forward iterator.</para> + <para>A constant iterator whose value type is <type>value_type</type>. <sbr/>
+              一个常量迭代器,它的值类型为 <type>value_type</type>。</para>
+ <para>The iterator category is at least a forward iterator.<sbr/>
+              迭代器类别至少为前向迭代器。</para>
             </description>
           </typedef>
           <typedef name="local_iterator">
             <type><emphasis>implementation-defined</emphasis></type>
             <description>
- <para>An iterator with the same value type, difference type and pointer and reference type as <type>iterator</type>.</para> - <para>A local_iterator object can be used to iterate through a single bucket.</para> + <para>An iterator with the same value type, difference type and pointer and reference type as <type>iterator</type>.<sbr/> + 具有与 <type>iterator</type> 相同值类型、距离类型和指针、引用 类型的迭代器。</para> + <para>A local_iterator object can be used to iterate through a single bucket.<sbr/>
+              local_iterator 对象可用于遍历单个桶。</para>
             </description>
***The diff for this file has been truncated for email.***

Other related posts:

  • » [boost-doc-zh] r420 committed - 翻译 unordered 库的 qbk/xml 文件 - boost-doc-zh