...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::hash_value — Implementation of the hash function.
std::size_t hash_value(bool val); std::size_t hash_value(char val); std::size_t hash_value(signed char val); std::size_t hash_value(unsigned char val); std::size_t hash_value(wchar_t val); std::size_t hash_value(short val); std::size_t hash_value(unsigned short val); std::size_t hash_value(int val); std::size_t hash_value(unsigned int val); std::size_t hash_value(long val); std::size_t hash_value(unsigned long val); std::size_t hash_value(long long val); std::size_t hash_value(unsigned long long val); std::size_t hash_value(float val); std::size_t hash_value(double val); std::size_t hash_value(long double val); template<typename T> std::size_t hash_value(T* const& val); template<typename T, unsigned N> std::size_t hash_value(T (&val)[N]); template<typename T, unsigned N> std::size_t hash_value(const T (&val)[N]); template<typename Ch, typename A> std::size_t hash_value(std::basic_string<Ch, std::char_traits<Ch>, A> const& val); template<typename A, typename B> std::size_t hash_value(std::pair<A, B> const& val); template<typename T, typename A> std::size_t hash_value(std::vector<T, A> const& val); template<typename T, typename A> std::size_t hash_value(std::list<T, A> const& val); template<typename T, typename A> std::size_t hash_value(std::deque<T, A> const& val); template<typename K, typename C, typename A> std::size_t hash_value(std::set<K, C, A> const& val); template<typename K, typename C, typename A> std::size_t hash_value(std::multiset<K, C, A> const& val); template<typename K, typename T, typename C, typename A> std::size_t hash_value(std::map<K, T, C, A> const& val); template<typename K, typename T, typename C, typename A> std::size_t hash_value(std::multimap<K, T, C, A> const& val); template<typename T> std::size_t hash_value(std::complex<T> const& val);
Generally shouldn't be called directly by users, instead they should use
boost::hash
, boost::hash_range
or boost::hash_combine
which
call hash_value
without namespace qualification so that overloads
for custom types are found via ADL.
Notes: |
This is an extension to TR1 |
||||||||||||||||||
Throws: |
Only throws if a user supplied version of
hash_value
throws for an element of a container, or
one of the types stored in a pair.
|
||||||||||||||||||
Returns: |
|