Added more utility and fixed Flag type.
This commit is contained in:
19
source/mijin/util/hash.hpp
Normal file
19
source/mijin/util/hash.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(MIJIN_UTIL_HASH_HPP_INCLUDED)
|
||||
#define MIJIN_UTIL_HASH_HPP_INCLUDED 1
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace mijin
|
||||
{
|
||||
template<typename T, typename THasher = std::hash<T>>
|
||||
inline void hashCombine(std::size_t& seed, const T& value, const THasher& hasher = {})
|
||||
{
|
||||
seed ^= hasher(value) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // MIJIN_UTIL_HASH_HPP_INCLUDED
|
||||
Reference in New Issue
Block a user