Created
September 18, 2017 13:35
-
-
Save Akdeniz/3f18b7f9d6ab76002f0235f512f48966 to your computer and use it in GitHub Desktop.
hash combine template function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// taken from http://www.boost.org/doc/libs/1_55_0/doc/html/hash/reference.html#boost.hash_combine | |
#include <functional> | |
template <class T> | |
inline void hash_combine( std::size_t& seed, const T& v ) | |
{ | |
std::hash<T> hasher; | |
seed ^= hasher( v ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment