forked from boostorg/unordered
Unordered: Update equality documentation.
[SVN r74377]
This commit is contained in:
@@ -143,7 +143,8 @@ in some breaking changes:
|
|||||||
* Equality comparison has been changed to the C++11 specification.
|
* Equality comparison has been changed to the C++11 specification.
|
||||||
In a container with equivalent keys, elements in a group with equal
|
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,
|
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
|
* The behaviour of swap is different when the two containers to be
|
||||||
swapped has unequal allocators. It used to allocate new nodes using
|
swapped has unequal allocators. It used to allocate new nodes using
|
||||||
|
@@ -90,29 +90,6 @@ efficiency advantage of power of 2 hash tables.
|
|||||||
|
|
||||||
So, this implementation uses a prime number for the hash table size.
|
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]
|
[h2 Active Issues and Proposals]
|
||||||
|
|
||||||
[h3 C++0x allocators]
|
[h3 C++0x allocators]
|
||||||
|
46
doc/ref.php
46
doc/ref.php
@@ -967,9 +967,28 @@ EOL;
|
|||||||
<paramtype><?php echo $full_type; ?> const&</paramtype>
|
<paramtype><?php echo $full_type; ?> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<?php if($equivalent_keys): ?>
|
||||||
|
<para>Return <code>true</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every equivalent key group in
|
||||||
|
<code>x</code>, there is a group in <code>y</code>
|
||||||
|
for the same key, which is a permutation (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
<?php else: ?>
|
||||||
|
<para>Return <code>true</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every element in <code>x</code>,
|
||||||
|
there is an element in <code>y</code> with the same
|
||||||
|
for the same key, with an equal value (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
<?php endif; ?>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
@@ -991,9 +1010,28 @@ EOL;
|
|||||||
<paramtype><?php echo $full_type; ?> const&</paramtype>
|
<paramtype><?php echo $full_type; ?> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<?php if($equivalent_keys): ?>
|
||||||
|
<para>Return <code>false</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every equivalent key group in
|
||||||
|
<code>x</code>, there is a group in <code>y</code>
|
||||||
|
for the same key, which is a permutation (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
<?php else: ?>
|
||||||
|
<para>Return <code>false</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every element in <code>x</code>,
|
||||||
|
there is an element in <code>y</code> with the same
|
||||||
|
for the same key, with an equal value (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
<?php endif; ?>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
|
112
doc/ref.xml
112
doc/ref.xml
@@ -847,9 +847,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
<paramtype>unordered_set<Value, Hash, Pred, Alloc> const&</paramtype>
|
<paramtype>unordered_set<Value, Hash, Pred, Alloc> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<para>Return <code>true</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every element in <code>x</code>,
|
||||||
|
there is an element in <code>y</code> with the same
|
||||||
|
for the same key, with an equal value (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
@@ -872,9 +882,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
<paramtype>unordered_set<Value, Hash, Pred, Alloc> const&</paramtype>
|
<paramtype>unordered_set<Value, Hash, Pred, Alloc> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<para>Return <code>false</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every element in <code>x</code>,
|
||||||
|
there is an element in <code>y</code> with the same
|
||||||
|
for the same key, with an equal value (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
@@ -1759,9 +1779,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
<paramtype>unordered_multiset<Value, Hash, Pred, Alloc> const&</paramtype>
|
<paramtype>unordered_multiset<Value, Hash, Pred, Alloc> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<para>Return <code>true</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every equivalent key group in
|
||||||
|
<code>x</code>, there is a group in <code>y</code>
|
||||||
|
for the same key, which is a permutation (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
@@ -1784,9 +1814,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
<paramtype>unordered_multiset<Value, Hash, Pred, Alloc> const&</paramtype>
|
<paramtype>unordered_multiset<Value, Hash, Pred, Alloc> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<para>Return <code>false</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every equivalent key group in
|
||||||
|
<code>x</code>, there is a group in <code>y</code>
|
||||||
|
for the same key, which is a permutation (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
@@ -2722,9 +2762,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
<paramtype>unordered_map<Key, Mapped, Hash, Pred, Alloc> const&</paramtype>
|
<paramtype>unordered_map<Key, Mapped, Hash, Pred, Alloc> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<para>Return <code>true</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every element in <code>x</code>,
|
||||||
|
there is an element in <code>y</code> with the same
|
||||||
|
for the same key, with an equal value (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
@@ -2749,9 +2799,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
<paramtype>unordered_map<Key, Mapped, Hash, Pred, Alloc> const&</paramtype>
|
<paramtype>unordered_map<Key, Mapped, Hash, Pred, Alloc> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<para>Return <code>false</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every element in <code>x</code>,
|
||||||
|
there is an element in <code>y</code> with the same
|
||||||
|
for the same key, with an equal value (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
@@ -3648,9 +3708,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
<paramtype>unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const&</paramtype>
|
<paramtype>unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<para>Return <code>true</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every equivalent key group in
|
||||||
|
<code>x</code>, there is a group in <code>y</code>
|
||||||
|
for the same key, which is a permutation (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
@@ -3675,9 +3745,19 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
<paramtype>unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const&</paramtype>
|
<paramtype>unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const&</paramtype>
|
||||||
</parameter>
|
</parameter>
|
||||||
<type>bool</type>
|
<type>bool</type>
|
||||||
|
<description>
|
||||||
|
<para>Return <code>false</code> if <code>x.size() ==
|
||||||
|
y.size</code> and for every equivalent key group in
|
||||||
|
<code>x</code>, there is a group in <code>y</code>
|
||||||
|
for the same key, which is a permutation (using
|
||||||
|
<code>operator==</code> to compare the value types).
|
||||||
|
</para>
|
||||||
|
</description>
|
||||||
<notes>
|
<notes>
|
||||||
<para><emphasis>TODO</emphasis>: Documentation outdated.</para>
|
<para>The behavior of this function was changed to match
|
||||||
<para>This is a boost extension.</para>
|
the C++11 standard in Boost 1.48. If you wish to use
|
||||||
|
the old behaviour, define the macro
|
||||||
|
<code>BOOST_UNORDERED_DEPRECATED_EQUALITY</code>.</para>
|
||||||
<para>Behavior is undefined if the two containers don't have
|
<para>Behavior is undefined if the two containers don't have
|
||||||
equivalent equality predicates.</para>
|
equivalent equality predicates.</para>
|
||||||
</notes>
|
</notes>
|
||||||
|
Reference in New Issue
Block a user