Fix HashtableDebugAccess as in gtl

This commit is contained in:
greg7mdp
2022-06-21 21:03:16 -04:00
parent fa666ae03f
commit ce7710e9c3
+18 -5
View File
@@ -621,7 +621,7 @@ const typename T::key_type& GetKey(const typename T::key_type& key, char) {
// container.
// --------------------------------------------------------------------------
template <class Container, typename Enabler = void>
struct HashtableDebugAccess
struct HashtableDebugAccess
{
// Returns the number of probes required to find `key` in `c`. The "number of
// probes" is a concept that can vary by container. Implementations should
@@ -4394,8 +4394,16 @@ namespace hashtable_debug_internal {
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
template<typename, typename = void >
struct has_member_type_raw_hash_set : std::false_type
{};
template<typename T>
struct has_member_type_raw_hash_set<T, phmap::void_t<typename T::raw_hash_set>> : std::true_type
{};
template <typename Set>
struct HashtableDebugAccess<Set, phmap::void_t<typename Set::raw_hash_set>>
struct HashtableDebugAccess<Set, typename std::enable_if<has_member_type_raw_hash_set<Set>::value>::type>
{
using Traits = typename Set::PolicyTraits;
using Slot = typename Traits::slot_type;
@@ -4454,9 +4462,15 @@ struct HashtableDebugAccess<Set, phmap::void_t<typename Set::raw_hash_set>>
};
#if !defined(__clang__) // compilation error with clang++-12 -stdc++=20 (should fix )
template<typename, typename = void >
struct has_member_type_EmbeddedSet : std::false_type
{};
template<typename T>
struct has_member_type_EmbeddedSet<T, phmap::void_t<typename T::EmbeddedSet>> : std::true_type
{};
template <typename Set>
struct HashtableDebugAccess<Set, phmap::void_t<typename Set::EmbeddedSet>> {
struct HashtableDebugAccess<Set, typename std::enable_if<has_member_type_EmbeddedSet<Set>::value>::type> {
using Traits = typename Set::PolicyTraits;
using Slot = typename Traits::slot_type;
using EmbeddedSet = typename Set::EmbeddedSet;
@@ -4468,7 +4482,6 @@ struct HashtableDebugAccess<Set, phmap::void_t<typename Set::EmbeddedSet>> {
return HashtableDebugAccess<EmbeddedSet>::GetNumProbes(inner_set, key);
}
};
#endif
} // namespace hashtable_debug_internal
} // namespace priv