From a67e350fd9176e8fe20b00928bb04891aa6a4180 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Wed, 2 Feb 2022 11:07:50 -0800 Subject: [PATCH] Add Introduction section to AsciiDoc --- doc/hash/intro.adoc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/hash/intro.adoc b/doc/hash/intro.adoc index 8a9d0cb..60c731e 100644 --- a/doc/hash/intro.adoc +++ b/doc/hash/intro.adoc @@ -2,3 +2,21 @@ = Introduction :idprefix: intro_ + +xref:#ref_hash[boost::hash] is an implementation of the https://en.wikipedia.org/wiki/Hash_function[hash function^] object specified by the http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf[Draft Technical Report on C++ Library Extensions^] (TR1). It is the default hash function for link:../../../unordered/index.html[Boost.Unordered^], link:../../../intrusive/index.html[Boost.Intrusive^]'s unordered associative containers, and link:../../../multi_index/index.html[Boost.MultiIndex^]'s hash indicies and link:../../../bimap/index.html[Boost.Bimap^]'s `unordered_set_of`. + +As it is compliant with http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf[TR1^], it will work with: + +* integers +* floats +* pointers +* strings + +It also implements the extension proposed by Peter Dimov in issue 6.18 of the http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1837.pdf[Library Extension Technical Report Issues List^] (page 63), this adds support for: + +* arrays +* `std::pair` +* the standard containers. +* extending xref:#ref_hash[boost::hash] for custom types. + +NOTE: This hash function is designed to be used in containers based on the STL and is not suitable as a general purpose hash function. For more details see the <>.