mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-29 08:34:39 +08:00
Fix HashtableDebugAccess as in gtl
This commit is contained in:
Vendored
+18
-5
@@ -621,7 +621,7 @@ const typename T::key_type& GetKey(const typename T::key_type& key, char) {
|
|||||||
// container.
|
// container.
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
template <class Container, typename Enabler = void>
|
template <class Container, typename Enabler = void>
|
||||||
struct HashtableDebugAccess
|
struct HashtableDebugAccess
|
||||||
{
|
{
|
||||||
// Returns the number of probes required to find `key` in `c`. The "number of
|
// 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
|
// 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>
|
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 Traits = typename Set::PolicyTraits;
|
||||||
using Slot = typename Traits::slot_type;
|
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>
|
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 Traits = typename Set::PolicyTraits;
|
||||||
using Slot = typename Traits::slot_type;
|
using Slot = typename Traits::slot_type;
|
||||||
using EmbeddedSet = typename Set::EmbeddedSet;
|
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);
|
return HashtableDebugAccess<EmbeddedSet>::GetNumProbes(inner_set, key);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace hashtable_debug_internal
|
} // namespace hashtable_debug_internal
|
||||||
} // namespace priv
|
} // namespace priv
|
||||||
|
|||||||
Reference in New Issue
Block a user