diff options
Diffstat (limited to 'src/common/Common.h')
-rw-r--r-- | src/common/Common.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/common/Common.h b/src/common/Common.h index 4c209f89ec8..7a1ea247a94 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -21,7 +21,6 @@ #include "Define.h" -#include <unordered_map> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -32,14 +31,19 @@ #include <assert.h> #include <set> +#include <unordered_set> #include <list> #include <string> #include <map> +#include <unordered_map> #include <queue> #include <sstream> #include <algorithm> #include <memory> #include <vector> +#include <array> + +#include <boost/functional/hash.hpp> #include "Debugging/Errors.h" @@ -116,10 +120,11 @@ enum LocaleConstant LOCALE_zhTW = 5, LOCALE_esES = 6, LOCALE_esMX = 7, - LOCALE_ruRU = 8 + LOCALE_ruRU = 8, + + TOTAL_LOCALES }; -const uint8 TOTAL_LOCALES = 9; #define DEFAULT_LOCALE LOCALE_enUS #define MAX_LOCALES 8 @@ -156,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 |