15 #ifndef ABSL_CONTAINER_INTERNAL_RAW_HASH_MAP_H_ 16 #define ABSL_CONTAINER_INTERNAL_RAW_HASH_MAP_H_ 19 #include <type_traits> 26 namespace container_internal {
28 template <
class Policy,
class Hash,
class Eq,
class Alloc>
35 std::addressof(std::declval<typename raw_hash_map::reference>())));
40 std::addressof(std::declval<typename raw_hash_map::const_reference>())));
49 using key_arg =
typename KeyArgImpl::template type<K, key_type>;
56 using iterator =
typename raw_hash_map::raw_hash_set::iterator;
60 using raw_hash_map::raw_hash_set::raw_hash_set;
75 template <
class K = key_type,
class V = mapped_type, K* =
nullptr>
80 template <
class K = key_type,
class V = mapped_type, V* =
nullptr>
85 template <
class K = key_type,
class V = mapped_type>
96 template <
class K = key_type,
class V = mapped_type, K* =
nullptr>
101 template <
class K = key_type,
class V = mapped_type, V* =
nullptr>
106 template <
class K = key_type,
class V = mapped_type>
111 template <
class K =
key_type,
class... Args,
112 typename std::enable_if<
119 template <
class K =
key_type,
class... Args,
120 typename std::enable_if<
126 template <
class K =
key_type,
class... Args, K* =
nullptr>
128 return try_emplace(std::forward<K>(k), std::forward<Args>(args)...).first;
131 template <
class K =
key_type,
class... Args>
133 return try_emplace(k, std::forward<Args>(args)...).first;
136 template <
class K = key_type,
class P = Policy>
138 auto it = this->
find(key);
139 if (it == this->
end()) std::abort();
143 template <
class K = key_type,
class P = Policy>
145 auto it = this->
find(key);
146 if (it == this->
end()) std::abort();
150 template <
class K = key_type,
class P = Policy, K* =
nullptr>
155 template <
class K = key_type,
class P = Policy>
161 template <
class K,
class V>
165 this->
emplace_at(res.first, std::forward<K>(k), std::forward<V>(
v));
171 template <
class K =
key_type,
class... Args>
175 this->
emplace_at(res.first, std::piecewise_construct,
176 std::forward_as_tuple(std::forward<K>(k)),
177 std::forward_as_tuple(std::forward<Args>(args)...));
185 #endif // ABSL_CONTAINER_INTERNAL_RAW_HASH_MAP_H_
typename raw_hash_map::raw_hash_set::iterator iterator
iterator insert_or_assign(const_iterator, const key_arg< K > &k, const V &v)
MappedReference< P > operator[](const key_arg< K > &key)
typename KeyArgImpl::template type< K, key_type > key_arg
std::pair< iterator, bool > insert_or_assign(key_arg< K > &&k, const V &v)
iterator insert_or_assign(const_iterator, key_arg< K > &&k, V &&v)
iterator insert_or_assign(const_iterator, const key_arg< K > &k, V &&v)
std::pair< iterator, bool > insert_or_assign(const key_arg< K > &k, V &&v)
std::pair< iterator, bool > try_emplace(key_arg< K > &&k, Args &&...args)
std::pair< iterator, bool > try_emplace_impl(K &&k, Args &&...args)
void emplace_at(size_t i, Args &&...args)
MappedReference< P > operator[](key_arg< K > &&key)
MappedReference< P > at(const key_arg< K > &key)
iterator try_emplace(const_iterator, key_arg< K > &&k, Args &&...args)
typename absl::container_internal::FlatHashMapPolicy< K, V >::mapped_type mapped_type
decltype(P::value(std::addressof(std::declval< typename raw_hash_map::reference >()))) MappedReference
MappedConstReference< P > at(const key_arg< K > &key) const
std::pair< size_t, bool > find_or_prepare_insert(const K &key)
iterator insert_or_assign(const_iterator, key_arg< K > &&k, const V &v)
std::pair< iterator, bool > insert_or_assign_impl(K &&k, V &&v)
std::pair< iterator, bool > try_emplace(const key_arg< K > &k, Args &&...args)
decltype(P::value(std::addressof(std::declval< typename raw_hash_map::const_reference >()))) MappedConstReference
iterator iterator_at(size_t i)
iterator find(const key_arg< K > &key, size_t hash)
std::pair< iterator, bool > insert_or_assign(key_arg< K > &&k, V &&v)
typename absl::container_internal::FlatHashMapPolicy< K, V >::key_type key_type
iterator try_emplace(const_iterator, const key_arg< K > &k, Args &&...args)
typename raw_hash_map::raw_hash_set::const_iterator const_iterator
std::pair< iterator, bool > insert_or_assign(const key_arg< K > &k, const V &v)