I am trying to specialise a std::hash struct to accept my fixed<..> type, but am getting a fairly cryptic
std::size_t operator()(fixed<Size, ScalingFactorInverse, Signed> number) const {
^
Here is the hash specialisation:
template<std::size_t Size, uint64_t ScalingFactorInverse, bool Signed>
struct std::hash<fixed<Size, ScalingFactorInverse, Signed>>{
std::size_t operator()(fixed<Size, ScalingFactorInverse, Signed> number) const {
static std::hash<decltype(number.data)> hasher{};
return hasher(number.data);
}
};
Can somebody tell me what’s going wrong here?
Thanks in advance