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