Fixed HashCombine function under 32bits compilation

Former-commit-id: 2224a17279f057a922b67cb91b03823d033c51ec
This commit is contained in:
Lynix 2015-02-25 17:40:07 +01:00
parent fd80228a1c
commit c3864a1acb
1 changed files with 4 additions and 4 deletions

View File

@ -35,16 +35,16 @@ struct NzImplTupleUnpack<0>
template<typename T> template<typename T>
void NzHashCombine(std::size_t& seed, const T& v) void NzHashCombine(std::size_t& seed, const T& v)
{ {
const std::size_t kMul = 0x9ddfea08eb382d69ULL; const nzUInt64 kMul = 0x9ddfea08eb382d69ULL;
std::hash<T> hasher; std::hash<T> hasher;
std::size_t a = (hasher(v) ^ seed) * kMul; nzUInt64 a = (hasher(v) ^ seed) * kMul;
a ^= (a >> 47); a ^= (a >> 47);
std::size_t b = (seed ^ a) * kMul; nzUInt64 b = (seed ^ a) * kMul;
b ^= (b >> 47); b ^= (b >> 47);
seed = b * kMul; seed = static_cast<std::size_t>(b * kMul);
} }
template<typename F, typename... ArgsT> template<typename F, typename... ArgsT>