[+] Support for AuPair<T,Z>s as hashtable and binary tree keys
This commit is contained in:
parent
541e31b198
commit
55b0dafa56
@ -217,6 +217,21 @@ inline AuUInt AuHashCode(const T &ref)
|
||||
return AuHash::hash<T>()(ref);
|
||||
}
|
||||
|
||||
#include <auROXTL/auTuple.hpp>
|
||||
|
||||
namespace AuHash
|
||||
{
|
||||
template <typename T, typename Z>
|
||||
struct hash<AuPair<T, Z>>
|
||||
{
|
||||
constexpr AuUInt operator ()(const AuPair<T, Z> &pair) const
|
||||
{
|
||||
return AuHashCode(AuGet<0>(pair)) ^
|
||||
AuHashCode(AuGet<1>(pair));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
struct AuEnableHashCodeOnData
|
||||
{
|
||||
@ -228,4 +243,4 @@ struct AuEnableHashCodeOnData
|
||||
return AuFnv1a64Runtime(AuStaticCast<AuAddConst_t<T>>(this), sizeof(T));
|
||||
#endif
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user