forked from boostorg/unordered
Add a little bit of text about hash and equality functions to the intro, and add links to Boost.Hash.
[SVN r42518]
This commit is contained in:
@@ -45,14 +45,14 @@ Similarly, a custom hash function can be used for custom types:
|
|||||||
[import src_code/point1.cpp]
|
[import src_code/point1.cpp]
|
||||||
[point_example1]
|
[point_example1]
|
||||||
|
|
||||||
Although, customizing Boost.Hash is probably a better solution:
|
Although, customizing [link hash Boost.Hash] is probably a better solution:
|
||||||
|
|
||||||
[import src_code/point2.cpp]
|
[import src_code/point2.cpp]
|
||||||
[point_example2]
|
[point_example2]
|
||||||
|
|
||||||
See the Boost.Hash documentation for more detail on how to do this. Remember
|
See the [link hash Boost.Hash] documentation for more detail on how to do this.
|
||||||
that it relies on extensions to the draft standard - so it won't work on other
|
Remember that it relies on extensions to the draft standard - so it won't work
|
||||||
implementations of the unordered associative containers.
|
on other implementations of the unordered associative containers.
|
||||||
|
|
||||||
[table Methods for accessing the hash and equality functions.
|
[table Methods for accessing the hash and equality functions.
|
||||||
[[Method] [Description]]
|
[[Method] [Description]]
|
||||||
|
@@ -111,6 +111,16 @@ can be in any order. For example, it might be:
|
|||||||
three,3
|
three,3
|
||||||
missing,0
|
missing,0
|
||||||
|
|
||||||
|
To store an object in an unordered associative container requires both an
|
||||||
|
key equality function and a hash function. The default function objects in
|
||||||
|
the standard containers support integer types, floating point types, pointer
|
||||||
|
types, the standard strings and std::error_code. Since Boost.Unordered uses
|
||||||
|
[classref boost::hash] it also supports the standard containers and any types
|
||||||
|
customized for [link hash Boost.Hash]. You can also use your custom equality
|
||||||
|
predicates and hash functions. See the
|
||||||
|
[link unordered.hash_equality Equality Predicates and Hash Functions] section
|
||||||
|
for more details.
|
||||||
|
|
||||||
There are other differences, which are listed in the
|
There are other differences, which are listed in the
|
||||||
[link unordered.comparison Comparison with Associative Containers] section.
|
[link unordered.comparison Comparison with Associative Containers] section.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user