30 #ifndef ABSL_CONTAINER_FLAT_HASH_MAP_H_ 31 #define ABSL_CONTAINER_FLAT_HASH_MAP_H_ 35 #include <type_traits> 45 namespace container_internal {
46 template <
class K,
class V>
103 template <
class K,
class V,
106 class Allocator = std::allocator<std::pair<const K, V>>>
108 absl::container_internal::FlatHashMapPolicy<K, V>,
109 Hash, Eq, Allocator> {
183 using Base::capacity;
196 using Base::max_size;
309 using Base::insert_or_assign;
338 using Base::emplace_hint;
363 using Base::try_emplace;
439 using Base::contains;
454 using Base::equal_range;
480 using Base::operator[];
487 using Base::bucket_count;
493 using Base::load_factor;
511 using Base::max_load_factor;
516 using Base::get_allocator;
522 using Base::hash_function;
530 namespace container_internal {
532 template <
class K,
class V>
533 struct FlatHashMapPolicy {
540 template <
class Allocator,
class... Args>
545 template <
class Allocator>
550 template <
class Allocator>
556 template <
class F,
class... Args>
558 std::declval<F>(), std::declval<Args>()...))
559 apply(F&& f, Args&&... args) {
561 std::forward<Args>(args)...);
568 static V&
value(std::pair<const K, V>* kv) {
return kv->second; }
569 static const V&
value(
const std::pair<const K, V>* kv) {
return kv->second; }
574 namespace container_algorithm_internal {
577 template <
class Key,
class T,
class Hash,
class KeyEqual,
class Allocator>
585 #endif // ABSL_CONTAINER_FLAT_HASH_MAP_H_ static std::pair< const K, V > & element(slot_type *slot)
hash_default_eq< T > key_eq
std::pair< key_type, mapped_type > init_type
typename container_internal::HashEq< T >::Hash hash_default_hash
static V & value(std::pair< const K, V > *kv)
static std::function< void(void *, Slot *)> destroy
static void destroy(Allocator *alloc, slot_type *slot)
static void transfer(Allocator *alloc, slot_type *new_slot, slot_type *old_slot)
typename flat_hash_map::raw_hash_map Base
typename slot_policy::slot_type slot_type
std::pair< std::string, std::string > pair
void swap(absl::InlinedVector< T, N, A > &a, absl::InlinedVector< T, N, A > &b) noexcept(noexcept(a.swap(b)))
auto DecomposePair(F &&f, Args &&...args) -> decltype(memory_internal::DecomposePairImpl(std::forward< F >(f), PairArgs(std::forward< Args >(args)...)))
static std::function< void(void *, Slot *, Slot *)> transfer
static std::function< void(void *, Slot *, Slot)> construct
auto apply(Functor &&functor, Tuple &&t) -> decltype(utility_internal::apply_helper(absl::forward< Functor >(functor), absl::forward< Tuple >(t), absl::make_index_sequence< std::tuple_size< typename std::remove_reference< Tuple >::type >::value >
static size_t space_used(const slot_type *)
static const V & value(const std::pair< const K, V > *kv)
typename container_internal::HashEq< T >::Eq hash_default_eq
std::allocator< int > alloc
static void construct(Allocator *alloc, slot_type *slot, Args &&...args)
absl::hash_internal::Hash< T > Hash