diff --git a/doc/changes.qbk b/doc/changes.qbk
index a10f2b70..9254011d 100644
--- a/doc/changes.qbk
+++ b/doc/changes.qbk
@@ -143,7 +143,8 @@ in some breaking changes:
* Equality comparison has been changed to the C++11 specification.
In a container with equivalent keys, elements in a group with equal
keys used to have to be in the same order to be considered equal,
- now they can be a permutation of each other.
+ now they can be a permutation of each other. To keep the old
+ behavior define the macro `BOOST_UNORDERED_DEPRECATED_EQUALITY`.
* The behaviour of swap is different when the two containers to be
swapped has unequal allocators. It used to allocate new nodes using
@@ -154,4 +155,12 @@ in some breaking changes:
* Allocator's `construct` and `destroy` functions are called with raw
pointers, rather than the allocator's `pointer` type.
+* `emplace` used to emulate the variadic pair constructors that
+ appeared in early C++0x drafts. Since they were removed it no
+ longer does so. It does emulate the new `piecewise_construct`
+ pair constructors - only you need to use
+ `boost::piecewise_construct`. To use the old emulation of
+ the variadic consturctors define
+ `BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT`.
+
[endsect]
diff --git a/doc/rationale.qbk b/doc/rationale.qbk
index 19e8945c..90d982e4 100644
--- a/doc/rationale.qbk
+++ b/doc/rationale.qbk
@@ -44,6 +44,8 @@ bucket but there are a some serious problems with this:
So chained addressing is used.
+[/ (Removing for now as this is out of date)
+
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)
@@ -63,6 +65,17 @@ nodes in reverse order. This allows quick navigation to the end of a group (sinc
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.
+]
+
+[/ (Starting to write up new structure, might not be ready in time)
+The node used to be stored in a linked list for each bucket but that
+didn't meet the complexity requirements for C++11, so now the nodes
+are stored in one long single linked list. But there needs a way to get
+the bucket from the node, to do that a copy of the key's hash value is
+stored in the node. Another possibility would be to store a pointer to
+the bucket, or the bucket's index, but storing the hash value allows
+some operations to be faster.
+]
[h2 Number of Buckets]
@@ -90,58 +103,4 @@ efficiency advantage of power of 2 hash tables.
So, this implementation uses a prime number for the hash table size.
-[h2 Equality operators]
-
-/TODO/: This is out of date.
-
-`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==`.
-
-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.
-
-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]
-
-/TODO/: This is out of date.
-
-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]
-
-/TODO/: This is out of date.
-
-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-defects.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?]
-
-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.
-
[endsect]
diff --git a/doc/ref.php b/doc/ref.php
index 531d53d2..30d79a92 100644
--- a/doc/ref.php
+++ b/doc/ref.php
@@ -412,10 +412,13 @@ EOL;
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
- but using boost::unordered::piecewise_construct.
-
+ but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -454,9 +457,13 @@ EOL;
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -658,13 +665,19 @@ EOL;
&void
+
+ Swaps the contents of the container with the parameter.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
@@ -961,9 +974,28 @@ EOL;
const&bool
+
+
+ Return true if x.size() ==
+ y.size and for every equivalent key group in
+ x, there is a group in y
+ for the same key, which is a permutation (using
+ operator== to compare the value types).
+
+
+ Return true if x.size() ==
+ y.size and for every element in x,
+ there is an element in y with the same
+ for the same key, with an equal value (using
+ operator== to compare the value types).
+
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -985,9 +1017,28 @@ EOL;
const&bool
+
+
+ Return false if x.size() ==
+ y.size and for every equivalent key group in
+ x, there is a group in y
+ for the same key, which is a permutation (using
+ operator== to compare the value types).
+
+
+ Return false if x.size() ==
+ y.size and for every element in x,
+ there is an element in y with the same
+ for the same key, with an equal value (using
+ operator== to compare the value types).
+
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -1014,13 +1065,19 @@ EOL;
x.swap(y)
+
+ Swaps the contents of x and y.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of Hash or Pred.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
diff --git a/doc/ref.xml b/doc/ref.xml
index 14ca58db..a31236dd 100644
--- a/doc/ref.xml
+++ b/doc/ref.xml
@@ -350,10 +350,13 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
- but using boost::unordered::piecewise_construct.
-
+ but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -385,9 +388,13 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -574,13 +581,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_set&void
+
+ Swaps the contents of the container with the parameter.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
@@ -841,9 +854,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_set<Value, Hash, Pred, Alloc> const&bool
+
+ Return true if x.size() ==
+ y.size and for every element in x,
+ there is an element in y with the same
+ for the same key, with an equal value (using
+ operator== to compare the value types).
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -866,9 +889,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_set<Value, Hash, Pred, Alloc> const&bool
+
+ Return false if x.size() ==
+ y.size and for every element in x,
+ there is an element in y with the same
+ for the same key, with an equal value (using
+ operator== to compare the value types).
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -896,13 +929,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
x.swap(y)
+
+ Swaps the contents of x and y.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of Hash or Pred.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
@@ -1251,10 +1290,13 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
- but using boost::unordered::piecewise_construct.
-
+ but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -1286,9 +1328,13 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -1474,13 +1520,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_multiset&void
+
+ Swaps the contents of the container with the parameter.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
@@ -1741,9 +1793,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_multiset<Value, Hash, Pred, Alloc> const&bool
+
+ Return true if x.size() ==
+ y.size and for every equivalent key group in
+ x, there is a group in y
+ for the same key, which is a permutation (using
+ operator== to compare the value types).
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -1766,9 +1828,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_multiset<Value, Hash, Pred, Alloc> const&bool
+
+ Return false if x.size() ==
+ y.size and for every equivalent key group in
+ x, there is a group in y
+ for the same key, which is a permutation (using
+ operator== to compare the value types).
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -1796,13 +1868,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
x.swap(y)
+
+ Swaps the contents of x and y.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of Hash or Pred.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
@@ -2164,10 +2242,13 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
- but using boost::unordered::piecewise_construct.
-
+ but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -2199,9 +2280,13 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -2388,13 +2473,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_map&void
+
+ Swaps the contents of the container with the parameter.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
@@ -2692,9 +2783,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_map<Key, Mapped, Hash, Pred, Alloc> const&bool
+
+ Return true if x.size() ==
+ y.size and for every element in x,
+ there is an element in y with the same
+ for the same key, with an equal value (using
+ operator== to compare the value types).
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -2719,9 +2820,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_map<Key, Mapped, Hash, Pred, Alloc> const&bool
+
+ Return false if x.size() ==
+ y.size and for every element in x,
+ there is an element in y with the same
+ for the same key, with an equal value (using
+ operator== to compare the value types).
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -2751,13 +2862,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
x.swap(y)
+
+ Swaps the contents of x and y.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of Hash or Pred.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
@@ -3114,10 +3231,13 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
- but using boost::unordered::piecewise_construct.
-
+ but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -3149,9 +3269,13 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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.
- Since existing `std::pair` implementations don't support
+ Since existing std::pair implementations don't support
std::piecewise_construct this emulates it,
but using boost::unordered::piecewise_construct.
+ In version of Boost before 1.48 this emulated the variadic pair
+ constructor from older C++0x drafts. For backwards compatability
+ this can be enabled by defining the macro
+ BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT.
@@ -3337,13 +3461,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_multimap&void
+
+ Swaps the contents of the container with the parameter.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
@@ -3606,9 +3736,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const&bool
+
+ Return true if x.size() ==
+ y.size and for every equivalent key group in
+ x, there is a group in y
+ for the same key, which is a permutation (using
+ operator== to compare the value types).
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -3633,9 +3773,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const&bool
+
+ Return false if x.size() ==
+ y.size and for every equivalent key group in
+ x, there is a group in y
+ for the same key, which is a permutation (using
+ operator== to compare the value types).
+
+
- TODO: Documentation outdated.
- This is a boost extension.
+ The behavior of this function was changed to match
+ the C++11 standard in Boost 1.48. If you wish to use
+ the old behaviour, define the macro
+ BOOST_UNORDERED_DEPRECATED_EQUALITY.Behavior is undefined if the two containers don't have
equivalent equality predicates.
@@ -3665,13 +3815,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
x.swap(y)
+
+ Swaps the contents of x and y.
+ If Allocator::propagate_on_container_swap is declared and
+ Allocator::propagate_on_container_swap::value is true then the
+ containers' allocators are swapped. Otherwise, swapping with unequal allocators
+ results in undefined behavior.
+
- If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of Hash or Pred.
+ Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.
- TODO: Update swap documentation, no longer correct.
- For a discussion of the behavior when allocators aren't equal see
- the implementation details.
+ The exception specifications aren't quite the same as the C++11 standard, as
+ the equality predieate and hash function are swapped using their copy constructors.
diff --git a/include/boost/unordered/detail/allocator_helpers.hpp b/include/boost/unordered/detail/allocator_helpers.hpp
index 4cd6cfc8..3392ac03 100644
--- a/include/boost/unordered/detail/allocator_helpers.hpp
+++ b/include/boost/unordered/detail/allocator_helpers.hpp
@@ -22,15 +22,6 @@
#include
#include
-#if (defined(BOOST_NO_STD_ALLOCATOR) || defined(BOOST_DINKUMWARE_STDLIB)) \
- && !defined(__BORLANDC__)
-# define BOOST_UNORDERED_USE_ALLOCATOR_UTILITIES
-#endif
-
-#if defined(BOOST_UNORDERED_USE_ALLOCATOR_UTILITIES)
-# include
-#endif
-
#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
# include
#endif
@@ -87,17 +78,12 @@ namespace boost { namespace unordered { namespace detail {
// Rebind allocators. For some problematic libraries, use rebind_to
// from .
-# if defined(BOOST_UNORDERED_USE_ALLOCATOR_UTILITIES)
- template
- struct rebind_wrap : ::boost::detail::allocator::rebind_to {};
-# else
template
struct rebind_wrap
{
typedef typename Alloc::BOOST_NESTED_TEMPLATE rebind::other
type;
};
-# endif
template typename boost::add_lvalue_reference::type make();
struct choice9 { typedef char (&type)[9]; };
@@ -474,8 +460,4 @@ namespace boost { namespace unordered { namespace detail {
};
}}}
-#if defined(BOOST_UNORDERED_USE_ALLOCATOR_UTILITIES)
-# undef BOOST_UNORDERED_USE_ALLOCATOR_UTILITIES
-#endif
-
#endif
diff --git a/test/unordered/insert_tests.cpp b/test/unordered/insert_tests.cpp
index 54cca259..9db9e3f1 100644
--- a/test/unordered/insert_tests.cpp
+++ b/test/unordered/insert_tests.cpp
@@ -541,9 +541,11 @@ UNORDERED_AUTO_TEST(map_emplace_test)
{
boost::unordered_map x;
+#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
x.emplace();
BOOST_TEST(x.find(0) != x.end() &&
x.find(0)->second == overloaded_constructor());
+#endif
x.emplace(2, 3);
BOOST_TEST(x.find(2) != x.end() &&
@@ -569,8 +571,10 @@ UNORDERED_AUTO_TEST(set_emplace_test)
boost::unordered_set x;
overloaded_constructor check;
+#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
x.emplace();
BOOST_TEST(x.find(check) != x.end() && *x.find(check) == check);
+#endif
x.clear();
x.emplace(1);
diff --git a/test/unordered/unnecessary_copy_tests.cpp b/test/unordered/unnecessary_copy_tests.cpp
index ee5a1eaa..b033b0df 100644
--- a/test/unordered/unnecessary_copy_tests.cpp
+++ b/test/unordered/unnecessary_copy_tests.cpp
@@ -203,6 +203,7 @@ namespace unnecessary_copy_tests
{
reset();
T x;
+ COPY_COUNT(0); MOVE_COUNT(0);
BOOST_DEDUCED_TYPENAME T::value_type a;
COPY_COUNT(1); MOVE_COUNT(0);
x.emplace(boost::move(a));
@@ -237,6 +238,7 @@ namespace unnecessary_copy_tests
// 0 arguments
//
+#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
// The container will have to create a copy in order to compare with
// the existing element.
reset();
@@ -246,6 +248,7 @@ namespace unnecessary_copy_tests
#else
// source_cost doesn't make much sense here, but it seems to fit.
COPY_COUNT(1); MOVE_COUNT(source_cost);
+#endif
#endif
//
@@ -322,10 +325,12 @@ namespace unnecessary_copy_tests
// 0 arguments
//
+#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
// COPY_COUNT(1) would be okay here.
reset();
x.emplace();
COPY_COUNT(2); MOVE_COUNT(0);
+#endif
reset();
x.emplace(boost::unordered::piecewise_construct,