diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index 8a7e121..ffe68b2 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -3967,63 +3967,16 @@ public: // hash_default // -------------------------------------------------------------------------- -#if 0 - -struct int64_t_hash -{ - using is_transparent = void; - size_t operator()(int64_t v) const { - return (size_t)v; - } -}; - -template <> -struct HashEq { - using Hash = int64_t_hash; - using Eq = std::equal_to; -}; - -#endif - #if PHMAP_HAVE_STD_STRING_VIEW -struct StringHash -{ - using is_transparent = void; - - size_t operator()(std::string_view v) const { - return phmap::Hash{}(v); - } -}; - -// Supports heterogeneous lookup for string-like elements. -struct StringHashEq -{ - using Hash = StringHash; - struct Eq { - using is_transparent = void; - bool operator()(std::string_view lhs, std::string_view rhs) const { - return lhs == rhs; - } - }; -}; - -template <> -struct HashEq : StringHashEq {}; - -template <> -struct HashEq : StringHashEq {}; - - // support char16_t wchar_t .... template struct StringHashT { - using is_transparent = void; size_t operator()(std::basic_string_view v) const { - std::string_view bv{reinterpret_cast(v.data()), v.size()*sizeof(CharT)}; + std::string_view bv{reinterpret_cast(v.data()), v.size() * sizeof(CharT)}; return phmap::Hash{}(bv); } }; @@ -4033,14 +3986,22 @@ template struct StringHashEqT { using Hash = StringHashT; + struct Eq { using is_transparent = void; + bool operator()(std::basic_string_view lhs, std::basic_string_view rhs) const { return lhs == rhs; } }; }; +template <> +struct HashEq : StringHashEqT {}; + +template <> +struct HashEq : StringHashEqT {}; + // char16_t template <> struct HashEq : StringHashEqT {};