Skip to content

Instantly share code, notes, and snippets.

@Akdeniz
Created September 18, 2017 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akdeniz/3f18b7f9d6ab76002f0235f512f48966 to your computer and use it in GitHub Desktop.
Save Akdeniz/3f18b7f9d6ab76002f0235f512f48966 to your computer and use it in GitHub Desktop.
hash combine template function
// 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