diff --git a/src/hash.hh b/src/hash.hh index 8e5e319c..35e89e84 100644 --- a/src/hash.hh +++ b/src/hash.hh @@ -61,10 +61,12 @@ struct Hash // Traits specifying if two types have compatible hashing, that is, // if lhs == rhs => hash_value(lhs) == hash_value(rhs) template -constexpr bool HashCompatible = false; +struct HashCompatible : std::false_type {}; -template -constexpr bool HashCompatible = true; +template struct HashCompatible : std::true_type {}; + +template +constexpr bool IsHashCompatible = HashCompatible::value; } diff --git a/src/hash_map.hh b/src/hash_map.hh index 89c97b00..4263b195 100644 --- a/src/hash_map.hh +++ b/src/hash_map.hh @@ -156,7 +156,7 @@ struct HashMap template using EnableIfHashCompatible = std::enable_if_t< - HashCompatible> + IsHashCompatible> >; template> diff --git a/src/string.hh b/src/string.hh index 98d78ff6..bb026869 100644 --- a/src/string.hh +++ b/src/string.hh @@ -256,8 +256,8 @@ private: static_assert(std::is_trivial::value, ""); -template<> constexpr bool HashCompatible = true; -template<> constexpr bool HashCompatible = true; +template<> struct HashCompatible : std::true_type {}; +template<> struct HashCompatible : std::true_type {}; inline String::String(StringView str) : String{str.begin(), str.length()} {}