diff options
Diffstat (limited to 'src/common/Common.h')
-rw-r--r-- | src/common/Common.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/Common.h b/src/common/Common.h index 908cd487822..7a1ea247a94 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -161,4 +161,19 @@ namespace Trinity } } +//! Hash implementation for std::pair to allow using pairs in unordered_set or as key for unordered_map +//! Individual types used in pair must be hashable by boost::hash +namespace std +{ + template<class K, class V> + struct hash<std::pair<K, V>> + { + public: + size_t operator()(std::pair<K, V> const& key) const + { + return boost::hash_value(key); + } + }; +} + #endif |