From b496bc3fa29ddd55d622af12706624c8e38da342 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 14 Sep 2011 21:04:23 +0000 Subject: [PATCH] Unordered: fix swap documentation. [SVN r74376] --- doc/rationale.qbk | 11 ----- doc/ref.php | 28 ++++++++---- doc/ref.xml | 112 +++++++++++++++++++++++++++++++++------------- 3 files changed, 100 insertions(+), 51 deletions(-) diff --git a/doc/rationale.qbk b/doc/rationale.qbk index 19e8945c..25d5febb 100644 --- a/doc/rationale.qbk +++ b/doc/rationale.qbk @@ -126,17 +126,6 @@ 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 diff --git a/doc/ref.php b/doc/ref.php index 531d53d2..036c10af 100644 --- a/doc/ref.php +++ b/doc/ref.php @@ -658,13 +658,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. @@ -1014,13 +1020,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..65d47952 100644 --- a/doc/ref.xml +++ b/doc/ref.xml @@ -574,13 +574,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. @@ -896,13 +902,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. @@ -1474,13 +1486,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. @@ -1796,13 +1814,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. @@ -2388,13 +2412,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. @@ -2751,13 +2781,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. @@ -3337,13 +3373,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. @@ -3665,13 +3707,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.