17 #ifndef ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_HOOKS_H_ 18 #define ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_HOOKS_H_ 23 #include <type_traits> 27 namespace container_internal {
28 namespace hashtable_debug_internal {
32 template <
typename T,
typename =
typename T::mapped_type>
39 const typename T::key_type&
GetKey(
const typename T::key_type& key,
char) {
45 template <
class Container,
typename Enabler =
void>
56 const typename Container::key_type& key) {
57 if (!c.bucket_count())
return {};
58 size_t num_probes = 0;
59 size_t bucket = c.bucket(key);
60 for (
auto it = c.begin(bucket), e = c.end(bucket);; ++it, ++num_probes) {
61 if (it == e)
return num_probes;
62 if (c.key_eq()(key, GetKey<Container>(*it, 0)))
return num_probes;
81 #endif // ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_HOOKS_H_ auto GetKey(const typename T::value_type &pair, int) -> decltype(get< 0 >(pair))
std::pair< std::string, std::string > pair
static size_t GetNumProbes(const Container &c, const typename Container::key_type &key)
absl::string_view get(const Cont &c)