Files
unordered/doc/comparison.qbk
2006-07-01 22:33:29 +00:00

28 lines
1.4 KiB
Plaintext

[section:comparison Comparison with Associative Containers]
* The elements in an unordered container are organised into buckets, in an
unpredictable order. There are member functions to access these buckets which
was described earlier.
* The unordered associative containers don't support any comparison operators.
* Instead of being parameterized by an ordering relation `Compare`,
the unordered associative container are parameterized by a function object
`Hash` and an equivalence realtion `Pred`. The member types and accessor
member functions reflect this.
* Because of this, equivalent keys for unordered container are defined in
terms of `Pred`, while for the associative containers it's defined in terms
of `Compare`.
* Unordered associative containers' iterators can be invalidated by rehashing
or by inserting elements.
* Unordered associative containers' iterators are of at least the forward
iterator category. Associative containers' iterators are bidirectional.
* The unordered associative containers' constructors have extra parameters
for the number of buckets, the hash function and the equality predicate.
* The unordered associative container don't have a `lower_bound` or
`upper_bound` method - they wouldn't make any sense since the elements
aren't ordered.
* TODO: Complexity guarantees.
* TODO: Behaviour when exceptions throw. The unordered containers seem
a lot stronger defined here?
[endsect]