mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
Update the implementation details.
[SVN r47403]
This commit is contained in:
@ -96,6 +96,17 @@ 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 and hash functions]
|
||||||
|
|
||||||
|
`operator==` and `operator!=` are not included in the standard, but I've
|
||||||
|
added them as I think they could be useful and can be efficiently
|
||||||
|
implemented. They are specified
|
||||||
|
differently to the standard associative containers, comparing keys
|
||||||
|
using the equality predicate rather than `operator==`. This is inconsistent
|
||||||
|
with the other containers but it is probably closer to user's expectations.
|
||||||
|
I have also added a `hash_value` free function so that the containers can be
|
||||||
|
hashed by [classref boost::hash].
|
||||||
|
|
||||||
[h2 Active Issues and Proposals]
|
[h2 Active Issues and Proposals]
|
||||||
|
|
||||||
[h3 Removing unused allocator functions]
|
[h3 Removing unused allocator functions]
|
||||||
@ -181,32 +192,14 @@ It is not specified if `unordered_multiset` and `unordered_multimap` preserve th
|
|||||||
of elements with equivalent keys (i.e. if they're stable under `insert` and `erase`).
|
of elements with equivalent keys (i.e. if they're stable under `insert` and `erase`).
|
||||||
This is [@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#518 issue 581].
|
This is [@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#518 issue 581].
|
||||||
The current proposal is that insert, erase and rehash are stable - so they are here.
|
The current proposal is that insert, erase and rehash are stable - so they are here.
|
||||||
|
(Update: during the release of this version, this requirement was added to
|
||||||
|
[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2691.pdf
|
||||||
|
the lastest working draft]).
|
||||||
|
|
||||||
[h3 const_local_iterator cbegin, cend missing from TR1]
|
[h3 const_local_iterator cbegin, cend missing from TR1]
|
||||||
|
|
||||||
[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2482.html#691
|
[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2684.html#691
|
||||||
Issue 691] is that `cbegin` and `cend` are missing for local iterators.
|
Issue 691] is that `cbegin` and `cend` are missing for local iterators.
|
||||||
The current resolution is that they'll be added, so I've added them.
|
The current resolution is that they'll be added, so I've added them.
|
||||||
|
|
||||||
[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.
|
|
||||||
|
|
||||||
[h3 Equality operator]
|
|
||||||
|
|
||||||
While `operator==` and `operator!=` are not included in the standard, it's
|
|
||||||
possible to implement them for all the containers - this is helped by having
|
|
||||||
stable order of elements with equivalent keys. They will need to be specified
|
|
||||||
differently to the standard associative containers, probably comparing keys
|
|
||||||
using the equality predicate rather than `operator==`. This is inconsistent
|
|
||||||
with the other containers but it is probably closer to user's expectations.
|
|
||||||
|
|
||||||
If these are added then a `hash_value` free function should also be added.
|
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
Reference in New Issue
Block a user