mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Misc: Minor refactor to std::hash specialization for std::pair to avoid showing incorrect documentation in IDEs on entire std namespace
This commit is contained in:
@@ -32,20 +32,17 @@ 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 std::hash
|
||||
namespace std
|
||||
template<class K, class V>
|
||||
struct std::hash<std::pair<K, V>>
|
||||
{
|
||||
template<class K, class V>
|
||||
struct hash<std::pair<K, V>>
|
||||
public:
|
||||
size_t operator()(std::pair<K, V> const& p) const
|
||||
{
|
||||
public:
|
||||
size_t operator()(std::pair<K, V> const& p) const
|
||||
{
|
||||
size_t hashVal = 0;
|
||||
Trinity::hash_combine(hashVal, p.first);
|
||||
Trinity::hash_combine(hashVal, p.second);
|
||||
return hashVal;
|
||||
}
|
||||
};
|
||||
}
|
||||
size_t hashVal = 0;
|
||||
Trinity::hash_combine(hashVal, p.first);
|
||||
Trinity::hash_combine(hashVal, p.second);
|
||||
return hashVal;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // TrinityCore_Hash_h__
|
||||
|
||||
Reference in New Issue
Block a user