Unordered: Merge to release.

Using Boost.Move and better C++11 support.


[SVN r73987]
This commit is contained in:
Daniel James committed 2011-08-21 19:19:12 +00:00
1 parent 3fd5635d7d
commit a4372314c2
43 files changed
+7656 -4602

No files matched your search

+17
View File
@@ -134,4 +134,21 @@ First official release.
* Fix a bug when inserting into an `unordered_map` or `unordered_set` using
iterators which returns `value_type` by copy.
[h2 Boost 1.48.0]
This is major change which has been converted to use Boost.Move's move
emulation, and be more compliant with the C++11 standard. This has resulted
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.
* The behaviour of swap is different when the two containers to be
swapped has unequal allocators. It used to allocate new nodes using
the appropriate allocators, it now swaps the allocators if
the allocator has a member structure `propagate_on_container_swap`,
such that `propagate_on_container_swap::value` is true.
[endsect]
+54
View File
@@ -0,0 +1,54 @@
[/ Copyright 2011 Daniel James.
/ 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:compliance C++11 Compliance]
/TODO/: Look into C++11's `std::pair`.
[section:allocator_compliance Use of allocators]
* Objects are not constructed using the allocator. The node containing them
is constructed using the allocator's `construct` function, but then the
object is constructed in a buffer in that node by calling the constructor
directly.
* Similarly the object is destructed by calling its destructor directly, and
then the allocator's `destroy` method is used to destruct the node.
* For most compilers `select_on_container_copy` is only detected for an
exact signature match in the allocator itself - not in a base. There is full
detection for g++ 4.4 or laster, Visual C++ 2008 or later, Clang and maybe
other compilers which support SFINAE for expressions.
* `pointer_traits` aren't used. Instead, pointer types are obtained from
rebound allocators.
* /TODO/: Any other defficiences of `allocator_traits` emulation.
* Pointers of base types are used to store the location of a derived type.
(/TODO/: I'm not sure if that isn't compliant).
[endsect]
[section:move Move emulation]
Move emulation is implemented using Boost.Move. If rvalue references are
available it will use them, but if not it uses a close, but imperfect emulation
and to get the advantage of using movable container elements, you'll need to
use Boost.Move.
* Non-copyable objects can be stored in the containers, but without support
for rvalue references the container will not be movable.
* The number of arguments used in emplace is limited to /TODO/.
* Argument forwarding is not perfect.
* /TODO/: Constructor call for pairs.
[endsect]
[section:other Other]
* When swapping, `Pred` and `Hash` are not currently swapped by calling
`swap`, their copy constructors are used.
* As a consequence when swapping an exception may be throw from their
copy constructor.
[endsect]
[endsect]
+1 -1
View File
@@ -126,7 +126,7 @@ a little to accomodate non-C++0x compilers.
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
[@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.
+1040
View File
File diff suppressed because it is too large. Load diff
+64 -64
View File
@@ -40,8 +40,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<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>
A binary function object that induces an equivalence relation on values of type <code>Value</code>.
It takes two arguments of type <code>Value</code> and returns a value of type 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>
@@ -360,7 +360,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<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><code>hint</code> 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 element with equivalent value.</para>
@@ -383,7 +383,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</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 <code>obj</code> in the container if and only if there is no element in the container with an equivalent value.</para>
</description>
<returns>
<para>The bool component of the return type is true if an insert took place.</para>
@@ -406,7 +406,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</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>Inserts <code>obj</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>
</description>
<returns>
@@ -815,8 +815,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<free-function-group name="Equality Comparisons">
<function name="operator==">
<template>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -839,8 +839,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</function>
<function name="operator!=">
<template>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -865,8 +865,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<free-function-group name="swap">
<function name="swap">
<template>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -909,7 +909,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</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.
</simpara></purpose>
<description>
<para>Based on chapter 23 of
@@ -929,8 +929,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<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>
A binary function object that induces an equivalence relation on values of type <code>Value</code>.
It takes two arguments of type <code>Value</code> and returns a value of type 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>
@@ -1248,7 +1248,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<type>iterator</type>
<description>
<para>Inserts an object, constructed with the arguments <code>args</code>, in the container.</para>
<para>hint is a suggestion to where the element should be inserted.</para>
<para><code>hint</code> is a suggestion to where the element should be inserted.</para>
</description>
<returns>
<para>An iterator pointing to the inserted element.</para>
@@ -1271,7 +1271,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</parameter>
<type>iterator</type>
<description>
<para>Inserts obj in the container.</para>
<para>Inserts <code>obj</code> in the container.</para>
</description>
<returns>
<para>An iterator pointing to the inserted element.</para>
@@ -1293,7 +1293,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</parameter>
<type>iterator</type>
<description>
<para>Inserts obj in the container.</para>
<para>Inserts <code>obj</code> in the container.</para>
<para>hint is a suggestion to where the element should be inserted.</para>
</description>
<returns>
@@ -1321,7 +1321,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</parameter>
<type>void</type>
<description>
<para>Inserts a range of elements into the container.</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.</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>
@@ -1702,8 +1702,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<free-function-group name="Equality Comparisons">
<function name="operator==">
<template>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -1726,8 +1726,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</function>
<function name="operator!=">
<template>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -1752,8 +1752,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<free-function-group name="swap">
<function name="swap">
<template>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Value">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -1798,7 +1798,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<default><type>std::equal_to&lt;Key&gt;</type></default>
</template-type-parameter>
<template-type-parameter name="Alloc">
<default><type>std::allocator&lt;std::pair&lt;Key const, Mapped&gt; &gt;</type></default>
<default><type>std::allocator&lt;std::pair&lt;Key const, Mapped&gt;&gt;</type></default>
</template-type-parameter>
</template>
<purpose><simpara>
@@ -1825,8 +1825,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<row>
<entry><emphasis>Pred</emphasis></entry>
<entry>A binary function object that implements an equivalence relation on values of type <code>Key</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>
A binary function object that induces an equivalence relation on values of type <code>Key</code>.
It takes two arguments of type <code>Key</code> and returns a value of type 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>
@@ -1882,7 +1882,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<typedef name="iterator">
<type><emphasis>implementation-defined</emphasis></type>
<description>
<para>A iterator whose value type is <type>value_type</type>. </para>
<para>An 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>
</description>
@@ -2148,7 +2148,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<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 key.</para>
<para>hint is a suggestion to where the element should be inserted.</para>
<para><code>hint</code> 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 element with equivalent key.</para>
@@ -2171,7 +2171,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</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 key.</para>
<para>Inserts <code>obj</code> in the container if and only if there is no element in the container with an equivalent key.</para>
</description>
<returns>
<para>The bool component of the return type is true if an insert took place.</para>
@@ -2194,7 +2194,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</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 key.</para>
<para>Inserts <code>obj</code> in the container if and only if there is no element in the container with an equivalent key.</para>
<para>hint is a suggestion to where the element should be inserted.</para>
</description>
<returns>
@@ -2638,10 +2638,10 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<free-function-group name="Equality Comparisons">
<function name="operator==">
<template>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -2664,10 +2664,10 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</function>
<function name="operator!=">
<template>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -2692,10 +2692,10 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<free-function-group name="swap">
<function name="swap">
<template>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -2736,11 +2736,11 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<default><type>std::equal_to&lt;Key&gt;</type></default>
</template-type-parameter>
<template-type-parameter name="Alloc">
<default><type>std::allocator&lt;std::pair&lt;Key const, Mapped&gt; &gt;</type></default>
<default><type>std::allocator&lt;std::pair&lt;Key const, Mapped&gt;&gt;</type></default>
</template-type-parameter>
</template>
<purpose><simpara>
An unordered associative container that associates keys with another value. The same key can be stored multiple times.
An unordered associative container that associates keys with another value. The same key can be stored multiple times.
</simpara></purpose>
<description>
<para>Based on chapter 23 of
@@ -2763,8 +2763,8 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<row>
<entry><emphasis>Pred</emphasis></entry>
<entry>A binary function object that implements an equivalence relation on values of type <code>Key</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>
A binary function object that induces an equivalence relation on values of type <code>Key</code>.
It takes two arguments of type <code>Key</code> and returns a value of type 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>
@@ -2820,7 +2820,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<typedef name="iterator">
<type><emphasis>implementation-defined</emphasis></type>
<description>
<para>A iterator whose value type is <type>value_type</type>. </para>
<para>An 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>
</description>
@@ -3085,7 +3085,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<type>iterator</type>
<description>
<para>Inserts an object, constructed with the arguments <code>args</code>, in the container.</para>
<para>hint is a suggestion to where the element should be inserted.</para>
<para><code>hint</code> is a suggestion to where the element should be inserted.</para>
</description>
<returns>
<para>An iterator pointing to the inserted element.</para>
@@ -3108,7 +3108,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</parameter>
<type>iterator</type>
<description>
<para>Inserts obj in the container.</para>
<para>Inserts <code>obj</code> in the container.</para>
</description>
<returns>
<para>An iterator pointing to the inserted element.</para>
@@ -3130,7 +3130,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</parameter>
<type>iterator</type>
<description>
<para>Inserts obj in the container.</para>
<para>Inserts <code>obj</code> in the container.</para>
<para>hint is a suggestion to where the element should be inserted.</para>
</description>
<returns>
@@ -3158,7 +3158,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</parameter>
<type>void</type>
<description>
<para>Inserts a range of elements into the container.</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 key.</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>
@@ -3539,10 +3539,10 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<free-function-group name="Equality Comparisons">
<function name="operator==">
<template>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -3565,10 +3565,10 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</function>
<function name="operator!=">
<template>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
@@ -3593,10 +3593,10 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<free-function-group name="swap">
<function name="swap">
<template>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Key">
</template-type-parameter>
<template-type-parameter name="Mapped">
</template-type-parameter>
<template-type-parameter name="Hash">
</template-type-parameter>
<template-type-parameter name="Pred">
+1
View File
@@ -31,6 +31,7 @@
[include:unordered buckets.qbk]
[include:unordered hash_equality.qbk]
[include:unordered comparison.qbk]
[include:unordered compliance.qbk]
[include:unordered rationale.qbk]
[include:unordered changes.qbk]
[xinclude ref.xml]