From 1b200a61942f727d3738dc9840612067cd263f46 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 11 Oct 2007 23:51:29 +0000 Subject: [PATCH] Update the unordered containers' documentation and notes for the most recent papers from the C++ working group - will probably have to do this again in a few weeks. [SVN r39951] --- doc/intro.qbk | 10 ++++++---- doc/rationale.qbk | 18 +++++++++++++++++- doc/ref.xml | 8 ++++---- .../boost/unordered/detail/hash_table_impl.hpp | 3 --- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/doc/intro.qbk b/doc/intro.qbk index de4c36ec..9335b667 100644 --- a/doc/intro.qbk +++ b/doc/intro.qbk @@ -3,13 +3,13 @@ / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] [def __tr1__ - [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2009.pdf + [@www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf C++ Standard Library Technical Report]] [def __boost-tr1__ [@http://www.boost.org/doc/html/boost_tr1.html Boost.TR1]] [def __draft__ - [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2009.pdf + [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2007/n2369.pdf Working Draft of the C++ Standard]] [def __hash-table__ [@http://en.wikipedia.org/wiki/Hash_table hash table]] @@ -34,8 +34,10 @@ and a hash function for the key. So the __tr1__ introduced the unordered associative containers, which are implemented using hash tables, and they have now been added to the __draft__. -This library supplies a standards compliant implementation that is proposed for -addition to boost. If accepted they should also be added to __boost-tr1__. +This library supplies an almost complete implementation of the specification in +the __draft__, (it doesn't support `emplace` yet, see the [link +unordered.rationale.future_developments Implementation Rationale] section for more +details). If accepted the containers should also be added to __boost-tr1__. `unordered_set` and `unordered_multiset` are defined in the header <[headerref boost/unordered_set.hpp]> diff --git a/doc/rationale.qbk b/doc/rationale.qbk index 33033798..81b97149 100644 --- a/doc/rationale.qbk +++ b/doc/rationale.qbk @@ -5,6 +5,12 @@ [def __wang__ [@http://www.concentric.net/~Ttwang/tech/inthash.htm Thomas Wang's article on integer hash functions]] +[def __n2345__ + [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2007/n2345.pdf + the August 2008 version of the working draft standard]] +[def __n2369__ + [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2007/n2369.pdf + the August 2008 version of the working draft standard]] [section:rationale Implementation Rationale] @@ -98,7 +104,7 @@ So, this implementation uses a prime number for the hash table size. This proposal suggests removing the `construct`, `destroy` and `address` member functions - all of which Boost.Unordered calls. It's near trivial to replace the calls with the appropriate code - and will simplify the -implementation. +implementation, as well as make supporting `emplace` easier. [h3 [@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#431 431. Swapping containers with unequal allocators]] @@ -120,4 +126,14 @@ should probably change it to a slow swap. The current proposal is that insert, erase and rehash are stable - so they are here. +[h2 Future Developments] + +[h3 Support for `emplace`] + +In __n2369__ a new member function, `emplace` was added to the containers to +allow placement insert, as described in __n2345__. To fully implement this +`std::forward` is required, along with new functions in `std::allocator` and +new constructors in `std::pair`. But partial support is possible - especially +if I don't use the `construct` member of allocators. + [endsect] diff --git a/doc/ref.xml b/doc/ref.xml index 4ee929ab..86eb7eb8 100644 --- a/doc/ref.xml +++ b/doc/ref.xml @@ -34,7 +34,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) For the normative reference see chapter 23 of - the working draft of the C++ standard [n2009]. + the working draft of the C++ standard [n2369]. Template Parameters @@ -617,7 +617,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) For the normative reference see chapter 23 of - the working draft of the C++ standard [n2009]. + the working draft of the C++ standard [n2369]. Template Parameters @@ -1209,7 +1209,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) For the normative reference see chapter 23 of - the working draft of the C++ standard [n2009]. + the working draft of the C++ standard [n2369]. Template Parameters @@ -1820,7 +1820,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) For the normative reference see chapter 23 of - the working draft of the C++ standard [n2009]. + the working draft of the C++ standard [n2369]. Template Parameters diff --git a/include/boost/unordered/detail/hash_table_impl.hpp b/include/boost/unordered/detail/hash_table_impl.hpp index d0c09f33..55b4281d 100644 --- a/include/boost/unordered/detail/hash_table_impl.hpp +++ b/include/boost/unordered/detail/hash_table_impl.hpp @@ -876,9 +876,6 @@ namespace boost { // Erase // - // Return type of erase(const_iterator): - // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1753.html#130 - // // no throw iterator_base erase(iterator_base r)