August 2017
Intermediate to advanced
438 pages
14h 19m
English
C++11 has the hash functional object; you may find it in the <functional> header in the std:: namespace. Hashing in Boost and standard library is fast and reliable. It does not allocate additional memory and also does not have virtual functions.
You may specialize hashing for your own types. In Boost, it is done via specializing the hash_value function in the namespace of a custom type:
// Must be in the namespace of string_hash_fast class.inline std::size_t hash_value(const string_hash_fast& v) { return v.comparison_;}
This is different from standard library specialization of std::hash, where you are required to make template specialization of the hash<> structure in the std:: namespace.
Hashing in Boost is defined for all ...
Read now
Unlock full access