mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 19:37:14 +02:00
Fix some typos, and use American spelling.
[SVN r42092]
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
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, in practise containers
|
||||
`B`, `C`, `D` and `E` (this is just for illustration, in practice containers
|
||||
will have more buckets).
|
||||
|
||||
[$../../libs/unordered/doc/diagrams/buckets.png]
|
||||
|
@ -8,13 +8,13 @@
|
||||
[[Associative Containers] [Unordered Associative Containers]]
|
||||
|
||||
[
|
||||
[Parametrised by an ordering relation `Compare`]
|
||||
[Parametrised by a function object `Hash` and an equivalence relation
|
||||
[Parameterized by an ordering relation `Compare`]
|
||||
[Parameterized by a function object `Hash` and an equivalence relation
|
||||
`Pred`]
|
||||
]
|
||||
[
|
||||
[Keys can be compared using `key_compare` which is accessed by member function `key_comp()`,
|
||||
values can be compared using `value_compare` whice is accessed by member function `value_comp()`.]
|
||||
values can be compared using `value_compare` which is accessed by member function `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.]
|
||||
@ -102,7 +102,7 @@
|
||||
]
|
||||
[
|
||||
[Insert a single element with a hint]
|
||||
[Amortised constant if t elements inserted right after hint,
|
||||
[Amortized constant if t elements inserted right after hint,
|
||||
logarithmic otherwise]
|
||||
[Average case constant, worst case linear (ie. the same as
|
||||
a normal insert).]
|
||||
@ -119,7 +119,7 @@
|
||||
]
|
||||
[
|
||||
[Erase a single element by iterator]
|
||||
[Amortised constant]
|
||||
[Amortized constant]
|
||||
[Average case: O(1), Worst case: O(`size()`)]
|
||||
]
|
||||
[
|
||||
|
@ -16,7 +16,7 @@ is declared as:
|
||||
class ``[classref boost::unordered_set unordered_set]``;
|
||||
|
||||
The hash function comes first as you might want to change the hash function
|
||||
but not the equality predicate, while if you were to change the behaviour
|
||||
but not the equality predicate, while if you were to change the behavior
|
||||
of the equality predicate you would have to change the hash function to match
|
||||
it. So, if you wanted to use the
|
||||
[@http://www.isthe.com/chongo/tech/comp/fnv/ FNV-1 hash] you could write:
|
||||
@ -45,7 +45,7 @@ Similarly, a custom hash function can be used for custom types:
|
||||
[import src_code/point1.cpp]
|
||||
[point_example1]
|
||||
|
||||
Although, customising Boost.Hash is probably a better solution:
|
||||
Although, customizing Boost.Hash is probably a better solution:
|
||||
|
||||
[import src_code/point2.cpp]
|
||||
[point_example2]
|
||||
|
@ -28,12 +28,12 @@ By specifying an interface for accessing the buckets of the container the
|
||||
standard pretty much requires that the hash table uses chained addressing.
|
||||
|
||||
It would be conceivable to write a hash table that uses another method. For
|
||||
example, an it could use open addressing, and use the lookup chain to act as a
|
||||
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:
|
||||
|
||||
* 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 - loosing the efficiency and most of the memory gain,
|
||||
indirection instead - losing the efficiency and most of the memory gain,
|
||||
the main advantages of open addressing.
|
||||
|
||||
* Local iterators would be very inefficient and may not be able to
|
||||
|
32
doc/ref.xml
32
doc/ref.xml
@ -149,7 +149,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<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 allocatorand 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.</para>
|
||||
</description>
|
||||
</constructor>
|
||||
<constructor>
|
||||
@ -263,7 +263,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
</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 elment 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.</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>
|
||||
@ -285,7 +285,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<para>hint is a suggestion to where the element should be inserted.</para>
|
||||
</description>
|
||||
<returns>
|
||||
<para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the elment 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.</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>
|
||||
@ -356,9 +356,9 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<paramtype>const_iterator</paramtype>
|
||||
</parameter>
|
||||
<type>iterator</type>
|
||||
<descritpion>
|
||||
<description>
|
||||
<para>Erases the elements in the range from <code>first</code> to <code>last</code>.</para>
|
||||
</descritpion>
|
||||
</description>
|
||||
<returns>
|
||||
<para>The iterator following the erased elements - i.e. <code>last</code>.</para>
|
||||
</returns>
|
||||
@ -729,7 +729,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<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 allocatorand 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.</para>
|
||||
</description>
|
||||
</constructor>
|
||||
<constructor>
|
||||
@ -935,9 +935,9 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<paramtype>const_iterator</paramtype>
|
||||
</parameter>
|
||||
<type>iterator</type>
|
||||
<descritpion>
|
||||
<description>
|
||||
<para>Erases the elements in the range from <code>first</code> to <code>last</code>.</para>
|
||||
</descritpion>
|
||||
</description>
|
||||
<returns>
|
||||
<para>The iterator following the erased elements - i.e. <code>last</code>.</para>
|
||||
</returns>
|
||||
@ -1324,7 +1324,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<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 allocatorand 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.</para>
|
||||
</description>
|
||||
</constructor>
|
||||
<constructor>
|
||||
@ -1438,7 +1438,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
</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 elment with equivalent key.</para>
|
||||
<para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.</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>
|
||||
@ -1460,7 +1460,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<para>hint is a suggestion to where the element should be inserted.</para>
|
||||
</description>
|
||||
<returns>
|
||||
<para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the elment with equivalent key.</para>
|
||||
<para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.</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>
|
||||
@ -1531,9 +1531,9 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<paramtype>const_iterator</paramtype>
|
||||
</parameter>
|
||||
<type>iterator</type>
|
||||
<descritpion>
|
||||
<description>
|
||||
<para>Erases the elements in the range from <code>first</code> to <code>last</code>.</para>
|
||||
</descritpion>
|
||||
</description>
|
||||
<returns>
|
||||
<para>The iterator following the erased elements - i.e. <code>last</code>.</para>
|
||||
</returns>
|
||||
@ -1948,7 +1948,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<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 allocatorand 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.</para>
|
||||
</description>
|
||||
</constructor>
|
||||
<constructor>
|
||||
@ -2154,9 +2154,9 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
<paramtype>const_iterator</paramtype>
|
||||
</parameter>
|
||||
<type>iterator</type>
|
||||
<descritpion>
|
||||
<description>
|
||||
<para>Erases the elements in the range from <code>first</code> to <code>last</code>.</para>
|
||||
</descritpion>
|
||||
</description>
|
||||
<returns>
|
||||
<para>The iterator following the erased elements - i.e. <code>last</code>.</para>
|
||||
</returns>
|
||||
|
Reference in New Issue
Block a user