diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2019-10-26 21:56:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-26 21:56:13 +0200 |
commit | 26f3e18c5cb882d48af702aa33519f4a2c74fa75 (patch) | |
tree | f17b70de1e1bca10e67a4f1076691a580f717f56 /src/common/hash.h | |
parent | Merge pull request #3027 from lioncash/lookup (diff) | |
parent | Shader_IR: Address Feedback. (diff) | |
download | yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.gz yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.bz2 yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.lz yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.xz yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.tar.zst yuzu-26f3e18c5cb882d48af702aa33519f4a2c74fa75.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/hash.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/hash.h b/src/common/hash.h index 40194d1ee..ebd4125e2 100644 --- a/src/common/hash.h +++ b/src/common/hash.h @@ -6,6 +6,8 @@ #include <cstddef> #include <cstring> +#include <utility> +#include <boost/functional/hash.hpp> #include "common/cityhash.h" #include "common/common_types.h" @@ -68,4 +70,13 @@ struct HashableStruct { } }; +struct PairHash { + template <class T1, class T2> + std::size_t operator()(const std::pair<T1, T2>& pair) const noexcept { + std::size_t seed = std::hash<T1>()(pair.first); + boost::hash_combine(seed, std::hash<T2>()(pair.second)); + return seed; + } +}; + } // namespace Common |