Moving around some math macros.

This commit is contained in:
Ben Vanik
2014-08-16 17:18:20 -07:00
parent 54ce9db743
commit 5b83cf5fd1
23 changed files with 148 additions and 137 deletions

View File

@@ -12,8 +12,19 @@
#include <xenia/common.h>
namespace xe {
uint64_t xe_hash64(const void* data, size_t length, uint64_t seed = 0);
inline size_t hash_combine(size_t seed) { return seed; }
template <typename T, typename... Ts>
size_t hash_combine(size_t seed, const T& v, const Ts&... vs) {
std::hash<T> hasher;
seed ^= hasher(v) + 0x9E3779B9 + (seed << 6) + (seed >> 2);
return hash_combine(seed, vs...);
}
uint64_t hash64(const void* data, size_t length, uint64_t seed = 0);
} // namespace xe
#endif // XENIA_CORE_HASH_H_