Kawe Mazidjatari 04bee896be Fix string/wstring type conflict
cppkore uses string/wstring as StringBase while we use std::string/std::wstring as string/wstring. Changed all types in cppkore to String/WString instead.
2022-05-21 21:51:35 +02:00

23 lines
545 B
C++

#pragma once
#include <cstdint>
#include "XXHash.h"
template<class TType>
struct HashComparer
{
constexpr static uint64_t GetHashCode(TType& Value)
{
if constexpr (std::is_arithmetic<TType>::value)
return Hashing::XXHash::HashValue(Value);
else if constexpr (std::is_enum<TType>::value)
return Hashing::XXHash::HashValue((uint32_t)Value);
else if constexpr (std::is_same<TType, String>::value)
return Hashing::XXHash::HashString(Value);
}
constexpr static bool Equals(TType& Lhs, TType& Rhs)
{
return (Lhs == Rhs);
}
};