30 #ifndef _UNORDERED_MAP_H 31 #define _UNORDERED_MAP_H 37 #if __glibcxx_containers_ranges // C++ >= 23 41 namespace std _GLIBCXX_VISIBILITY(default)
43 _GLIBCXX_BEGIN_NAMESPACE_VERSION
44 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
50 template<
typename _Key,
56 using __umap_hashtable = _Hashtable<_Key, std::pair<const _Key, _Tp>,
57 _Alloc, __detail::_Select1st,
59 __detail::_Mod_range_hashing,
60 __detail::_Default_ranged_hash,
61 __detail::_Prime_rehash_policy, _Tr>;
67 template<
typename _Key,
73 using __ummap_hashtable = _Hashtable<_Key, std::pair<const _Key, _Tp>,
74 _Alloc, __detail::_Select1st,
76 __detail::_Mod_range_hashing,
77 __detail::_Default_ranged_hash,
78 __detail::_Prime_rehash_policy, _Tr>;
80 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
108 template<
typename _Key,
typename _Tp,
114 typedef __umap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
124 typedef typename _Hashtable::hasher
hasher;
143 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED 144 using node_type =
typename _Hashtable::node_type;
145 using insert_return_type =
typename _Hashtable::insert_return_type;
162 const hasher& __hf =
hasher(),
165 : _M_h(__n, __hf, __eql, __a)
181 template<
typename _InputIterator>
184 const hasher& __hf =
hasher(),
187 : _M_h(__first, __last, __n, __hf, __eql, __a)
211 const allocator_type& __a)
212 : _M_h(__umap._M_h, __a)
221 const allocator_type& __a)
222 noexcept( noexcept(_Hashtable(
std::move(__umap._M_h), __a)) )
239 const hasher& __hf =
hasher(),
242 : _M_h(__l, __n, __hf, __eql, __a)
250 const allocator_type& __a)
256 template<
typename _InputIterator>
258 const allocator_type& __a)
262 template<
typename _InputIterator>
265 const allocator_type& __a)
269 template<
typename _InputIterator>
271 size_type __n,
const hasher& __hf,
272 const allocator_type& __a)
278 const allocator_type& __a)
285 const allocator_type& __a)
290 size_type __n,
const hasher& __hf,
291 const allocator_type& __a)
295 #if __glibcxx_containers_ranges // C++ >= 23 309 template<__detail::__container_compatible_range<value_type> _Rg>
312 const hasher& __hf =
hasher(),
315 : _M_h(__n, __hf, __eql, __a)
316 { insert_range(std::forward<_Rg>(__rg)); }
320 template<__detail::__container_compatible_range<value_type> _Rg>
321 unordered_map(from_range_t, _Rg&& __rg,
const allocator_type& __a)
323 { insert_range(std::forward<_Rg>(__rg)); }
325 template<__detail::__container_compatible_range<value_type> _Rg>
327 const allocator_type& __a)
329 { insert_range(std::forward<_Rg>(__rg)); }
331 template<__detail::__container_compatible_range<value_type> _Rg>
333 const hasher& __hf,
const allocator_type& __a)
335 { insert_range(std::forward<_Rg>(__rg)); }
367 {
return _M_h.get_allocator(); }
372 _GLIBCXX_NODISCARD
bool 374 {
return _M_h.empty(); }
379 {
return _M_h.size(); }
384 {
return _M_h.max_size(); }
394 {
return _M_h.begin(); }
403 {
return _M_h.begin(); }
407 {
return _M_h.begin(); }
416 {
return _M_h.end(); }
425 {
return _M_h.end(); }
429 {
return _M_h.end(); }
454 template<
typename... _Args>
457 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
486 template<
typename... _Args>
489 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
491 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED 496 __glibcxx_assert(__pos !=
end());
497 return _M_h.extract(__pos);
503 {
return _M_h.extract(__key); }
505 #ifdef __glibcxx_associative_heterogeneous_erasure // C++23 506 template <__heterogeneous_hash_key<unordered_map> _Kt>
509 {
return _M_h._M_extract_tr(__key); }
515 {
return _M_h._M_reinsert_node(
std::move(__nh)); }
520 {
return _M_h._M_reinsert_node(
std::move(__nh)).position; }
521 #endif // node_extract 523 #ifdef __glibcxx_unordered_map_try_emplace // C++ >= 17 && HOSTED 547 template <
typename... _Args>
551 return _M_h.try_emplace(
cend(), __k, std::forward<_Args>(__args)...);
555 template <
typename... _Args>
560 std::forward<_Args>(__args)...);
563 #ifdef __glibcxx_associative_heterogeneous_insertion // C++26 564 template <__heterogeneous_hash_key<unordered_map> _Kt,
typename ..._Args>
568 return _M_h.try_emplace(
cend(),
569 std::forward<_Kt>(__k), std::forward<_Args>(__args)...);
603 template <
typename... _Args>
608 return _M_h.try_emplace(__hint, __k,
609 std::forward<_Args>(__args)...).first;
613 template <
typename... _Args>
615 try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
617 return _M_h.try_emplace(__hint,
std::move(__k),
618 std::forward<_Args>(__args)...).first;
620 #endif // __glibcxx_unordered_map_try_emplace 622 #ifdef __glibcxx_associative_heterogeneous_insertion // C++26 623 template <__heterogeneous_hash_key<unordered_map> _Kt,
typename ..._Args>
625 try_emplace(const_iterator __hint, _Kt&& __k, _Args&&... __args)
627 return _M_h.try_emplace(__hint,
628 std::forward<_Kt>(__k), std::forward<_Args>(__args)...).first;
653 {
return _M_h.insert(__x); }
661 template<
typename _Pair>
662 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
665 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
691 insert(const_iterator __hint,
const value_type& __x)
692 {
return _M_h.insert(__hint, __x); }
697 insert(const_iterator __hint, value_type&& __x)
698 {
return _M_h.insert(__hint,
std::move(__x)); }
700 template<
typename _Pair>
701 __enable_if_t<is_constructible<value_type, _Pair&&>::value, iterator>
702 insert(const_iterator __hint, _Pair&& __x)
703 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
715 template<
typename _InputIterator>
717 insert(_InputIterator __first, _InputIterator __last)
718 { _M_h.insert(__first, __last); }
729 { _M_h.insert(__l); }
731 #if __glibcxx_containers_ranges // C++ >= 23 738 template<__detail::__container_compatible_range<value_type> _Rg>
740 insert_range(_Rg&& __rg)
742 auto __first = ranges::begin(__rg);
743 const auto __last = ranges::end(__rg);
744 for (; __first != __last; ++__first)
745 _M_h.emplace(*__first);
749 #ifdef __glibcxx_unordered_map_try_emplace // >= C++17 && HOSTED 771 template <
typename _Obj>
775 auto __ret = _M_h.try_emplace(
cend(), __k,
776 std::forward<_Obj>(__obj));
778 __ret.first->second = std::forward<_Obj>(__obj);
783 template <
typename _Obj>
788 std::forward<_Obj>(__obj));
790 __ret.first->second = std::forward<_Obj>(__obj);
794 #ifdef __glibcxx_associative_heterogeneous_insertion // C++26 795 template <__heterogeneous_hash_key<unordered_map> _Kt,
typename _Obj>
799 auto __ret = _M_h.try_emplace(
800 cend(), std::forward<_Kt>(__k), std::forward<_Obj>(__obj));
802 __ret.first->second = std::forward<_Obj>(__obj);
835 template <
typename _Obj>
840 auto __ret = _M_h.try_emplace(__hint, __k, std::forward<_Obj>(__obj));
842 __ret.first->second = std::forward<_Obj>(__obj);
847 template <
typename _Obj>
851 auto __ret = _M_h.try_emplace(__hint,
std::move(__k),
852 std::forward<_Obj>(__obj));
854 __ret.first->second = std::forward<_Obj>(__obj);
858 #ifdef __glibcxx_associative_heterogeneous_insertion // C++26 859 template <__heterogeneous_hash_key<unordered_map> _Kt,
typename _Obj>
863 auto __ret = _M_h.try_emplace(__hint,
864 std::forward<_Kt>(__k), std::forward<_Obj>(__obj));
866 __ret.first->second = std::forward<_Obj>(__obj);
871 #endif // unordered_map_try_emplace 889 {
return _M_h.erase(__position); }
894 {
return _M_h.erase(__position); }
912 {
return _M_h.erase(__x); }
914 #ifdef __glibcxx_associative_heterogeneous_erasure // C++23 915 template <__heterogeneous_hash_key<unordered_map> _Kt>
918 {
return _M_h._M_erase_tr(__key); }
937 erase(const_iterator __first, const_iterator __last)
938 {
return _M_h.erase(__first, __last); }
962 noexcept( noexcept(_M_h.swap(__x._M_h)) )
963 { _M_h.swap(__x._M_h); }
965 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED 966 template<
typename,
typename,
typename>
967 friend class std::_Hash_merge_helper;
969 template<
typename _H2,
typename _P2>
973 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
977 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
978 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
981 template<
typename _H2,
typename _P2>
985 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
986 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
989 template<
typename _H2,
typename _P2>
993 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
994 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
997 template<
typename _H2,
typename _P2>
1000 { merge(__source); }
1001 #endif // node_extract 1009 {
return _M_h.hash_function(); }
1015 {
return _M_h.key_eq(); }
1033 {
return _M_h.find(__x); }
1035 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 1036 template<
typename _Kt>
1038 find(
const _Kt& __x) -> decltype(_M_h._M_find_tr(__x))
1039 {
return _M_h._M_find_tr(__x); }
1044 {
return _M_h.find(__x); }
1046 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 1047 template<
typename _Kt>
1049 find(
const _Kt& __x)
const -> decltype(_M_h._M_find_tr(__x))
1050 {
return _M_h._M_find_tr(__x); }
1066 {
return _M_h.count(__x); }
1068 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 1069 template<
typename _Kt>
1071 count(
const _Kt& __x)
const -> decltype(_M_h._M_count_tr(__x))
1072 {
return _M_h._M_count_tr(__x); }
1076 #if __cplusplus > 201703L 1085 {
return _M_h.find(__x) != _M_h.end(); }
1087 template<
typename _Kt>
1090 -> decltype(_M_h._M_find_tr(__x), void(),
true)
1091 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
1106 {
return _M_h.equal_range(__x); }
1108 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 1109 template<
typename _Kt>
1112 -> decltype(_M_h._M_equal_range_tr(__x))
1113 {
return _M_h._M_equal_range_tr(__x); }
1118 {
return _M_h.equal_range(__x); }
1120 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 1121 template<
typename _Kt>
1124 -> decltype(_M_h._M_equal_range_tr(__x))
1125 {
return _M_h._M_equal_range_tr(__x); }
1144 {
return _M_h[__k]; }
1150 #ifdef __glibcxx_associative_heterogeneous_insertion // C++26 1151 template <__heterogeneous_hash_key<unordered_map> _Kt>
1155 return try_emplace(std::forward<_Kt>(__k)).first->second;
1170 {
return _M_h.at(__k); }
1172 #ifdef __glibcxx_associative_heterogeneous_insertion // C++26 1173 template <__heterogeneous_hash_key<unordered_map> _Kt>
1176 {
return _M_h._M_at_tr(__k); }
1180 at(
const key_type& __k)
const 1181 {
return _M_h.at(__k); }
1183 #ifdef __glibcxx_associative_heterogeneous_insertion // C++26 1184 template <__heterogeneous_hash_key<unordered_map> _Kt>
1186 at(
const _Kt& __k)
const 1187 {
return _M_h._M_at_tr(__k); }
1196 {
return _M_h.bucket_count(); }
1201 {
return _M_h.max_bucket_count(); }
1209 bucket_size(size_type __n)
const 1210 {
return _M_h.bucket_size(__n); }
1219 bucket(
const key_type& __key)
const 1220 {
return _M_h.bucket(__key); }
1222 #ifdef __glibcxx_associative_heterogeneous_insertion // C++26 1223 template <__heterogeneous_hash_key<unordered_map> _Kt>
1225 bucket(
const _Kt& __key)
const 1226 {
return _M_h._M_bucket_tr(__key); }
1238 {
return _M_h.begin(__n); }
1247 const_local_iterator
1249 {
return _M_h.begin(__n); }
1251 const_local_iterator
1253 {
return _M_h.cbegin(__n); }
1264 {
return _M_h.end(__n); }
1273 const_local_iterator
1275 {
return _M_h.end(__n); }
1277 const_local_iterator
1279 {
return _M_h.cend(__n); }
1287 {
return _M_h.load_factor(); }
1293 {
return _M_h.max_load_factor(); }
1301 { _M_h.max_load_factor(__z); }
1312 { _M_h.rehash(__n); }
1323 { _M_h.reserve(__n); }
1325 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1332 #if __cpp_deduction_guides >= 201606 1334 template<
typename _InputIterator,
1338 typename = _RequireInputIter<_InputIterator>,
1339 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1340 typename = _RequireNotAllocator<_Pred>,
1341 typename = _RequireAllocator<_Allocator>>
1344 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1346 __iter_val_t<_InputIterator>,
1347 _Hash, _Pred, _Allocator>;
1349 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1350 typename _Pred = equal_to<_Key>,
1351 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1352 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1353 typename = _RequireNotAllocator<_Pred>,
1354 typename = _RequireAllocator<_Allocator>>
1357 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1360 template<
typename _InputIterator,
typename _Allocator,
1361 typename = _RequireInputIter<_InputIterator>,
1362 typename = _RequireAllocator<_Allocator>>
1366 __iter_val_t<_InputIterator>,
1371 template<
typename _InputIterator,
typename _Allocator,
1372 typename = _RequireInputIter<_InputIterator>,
1373 typename = _RequireAllocator<_Allocator>>
1376 __iter_val_t<_InputIterator>,
1377 hash<__iter_key_t<_InputIterator>>,
1378 equal_to<__iter_key_t<_InputIterator>>,
1381 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1382 typename = _RequireInputIter<_InputIterator>,
1383 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1384 typename = _RequireAllocator<_Allocator>>
1389 __iter_val_t<_InputIterator>, _Hash,
1390 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1392 template<
typename _Key,
typename _Tp,
typename _Allocator,
1393 typename = _RequireAllocator<_Allocator>>
1399 template<
typename _Key,
typename _Tp,
typename _Allocator,
1400 typename = _RequireAllocator<_Allocator>>
1404 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1405 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1406 typename = _RequireAllocator<_Allocator>>
1412 #if __glibcxx_containers_ranges // C++ >= 23 1413 template<ranges::input_range _Rg,
1416 __allocator_like _Allocator =
1419 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1421 __detail::__range_mapped_type<_Rg>,
1422 _Hash, _Pred, _Allocator>;
1424 template<ranges::input_range _Rg,
1425 __allocator_like _Allocator>
1429 __detail::__range_mapped_type<_Rg>,
1434 template<ranges::input_range _Rg,
1435 __allocator_like _Allocator>
1438 __detail::__range_mapped_type<_Rg>,
1439 hash<__detail::__range_key_type<_Rg>>,
1440 equal_to<__detail::__range_key_type<_Rg>>,
1443 template<ranges::input_range _Rg,
1444 __not_allocator_like _Hash,
1445 __allocator_like _Allocator>
1449 __detail::__range_mapped_type<_Rg>,
1450 _Hash, equal_to<__detail::__range_key_type<_Rg>>,
1480 template<
typename _Key,
typename _Tp,
1482 typename _Pred = equal_to<_Key>,
1486 typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
1515 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED 1516 using node_type =
typename _Hashtable::node_type;
1533 const hasher& __hf =
hasher(),
1536 : _M_h(__n, __hf, __eql, __a)
1552 template<
typename _InputIterator>
1555 const hasher& __hf =
hasher(),
1558 : _M_h(__first, __last, __n, __hf, __eql, __a)
1582 const allocator_type& __a)
1583 : _M_h(__ummap._M_h, __a)
1592 const allocator_type& __a)
1593 noexcept( noexcept(_Hashtable(
std::move(__ummap._M_h), __a)) )
1610 const hasher& __hf =
hasher(),
1613 : _M_h(__l, __n, __hf, __eql, __a)
1621 const allocator_type& __a)
1627 template<
typename _InputIterator>
1629 const allocator_type& __a)
1633 template<
typename _InputIterator>
1636 const allocator_type& __a)
1640 template<
typename _InputIterator>
1642 size_type __n,
const hasher& __hf,
1643 const allocator_type& __a)
1650 const allocator_type& __a)
1656 const allocator_type& __a)
1661 size_type __n,
const hasher& __hf,
1662 const allocator_type& __a)
1666 #if __glibcxx_containers_ranges // C++ >= 23 1680 template<__detail::__container_compatible_range<value_type> _Rg>
1683 const hasher& __hf =
hasher(),
1686 : _M_h(__n, __hf, __eql, __a)
1687 { insert_range(std::forward<_Rg>(__rg)); }
1691 template<__detail::__container_compatible_range<value_type> _Rg>
1694 { insert_range(std::forward<_Rg>(__rg)); }
1696 template<__detail::__container_compatible_range<value_type> _Rg>
1698 const allocator_type& __a)
1700 { insert_range(std::forward<_Rg>(__rg)); }
1702 template<__detail::__container_compatible_range<value_type> _Rg>
1704 const hasher& __hf,
const allocator_type& __a)
1706 { insert_range(std::forward<_Rg>(__rg)); }
1738 {
return _M_h.get_allocator(); }
1743 _GLIBCXX_NODISCARD
bool 1745 {
return _M_h.empty(); }
1750 {
return _M_h.size(); }
1755 {
return _M_h.max_size(); }
1765 {
return _M_h.begin(); }
1774 {
return _M_h.begin(); }
1778 {
return _M_h.begin(); }
1787 {
return _M_h.end(); }
1796 {
return _M_h.end(); }
1800 {
return _M_h.end(); }
1820 template<
typename... _Args>
1823 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1847 template<
typename... _Args>
1850 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1864 {
return _M_h.insert(__x); }
1870 template<
typename _Pair>
1871 __enable_if_t<is_constructible<value_type, _Pair&&>::value, iterator>
1873 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
1897 insert(const_iterator __hint,
const value_type& __x)
1898 {
return _M_h.insert(__hint, __x); }
1903 insert(const_iterator __hint, value_type&& __x)
1904 {
return _M_h.insert(__hint,
std::move(__x)); }
1906 template<
typename _Pair>
1907 __enable_if_t<is_constructible<value_type, _Pair&&>::value, iterator>
1909 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
1921 template<
typename _InputIterator>
1923 insert(_InputIterator __first, _InputIterator __last)
1924 { _M_h.insert(__first, __last); }
1936 { _M_h.insert(__l); }
1938 #if __glibcxx_containers_ranges // C++ >= 23 1945 template<__detail::__container_compatible_range<value_type> _Rg>
1947 insert_range(_Rg&& __rg)
1949 auto __first = ranges::begin(__rg);
1950 const auto __last = ranges::end(__rg);
1951 if (__first == __last)
1954 if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
1955 _M_h._M_rehash_insert(
size_type(ranges::distance(__rg)));
1957 _M_h._M_rehash_insert(1);
1959 for (; __first != __last; ++__first)
1960 _M_h.emplace(*__first);
1964 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED 1969 __glibcxx_assert(__pos !=
end());
1970 return _M_h.extract(__pos);
1976 {
return _M_h.extract(__key); }
1978 #ifdef __glibcxx_associative_heterogeneous_erasure // C++23 1979 template <__heterogeneous_hash_key<unordered_multimap> _Kt>
1982 {
return _M_h._M_extract_tr(__key); }
1988 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1992 insert(const_iterator __hint, node_type&& __nh)
1993 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1994 #endif // node_extract 2012 {
return _M_h.erase(__position); }
2017 {
return _M_h.erase(__position); }
2034 {
return _M_h.erase(__x); }
2036 #ifdef __glibcxx_associative_heterogeneous_erasure // C++23 2037 template <__heterogeneous_hash_key<unordered_multimap> _Kt>
2040 {
return _M_h._M_erase_tr(__x); }
2061 erase(const_iterator __first, const_iterator __last)
2062 {
return _M_h.erase(__first, __last); }
2086 noexcept( noexcept(_M_h.swap(__x._M_h)) )
2087 { _M_h.swap(__x._M_h); }
2089 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED 2090 template<
typename,
typename,
typename>
2091 friend class std::_Hash_merge_helper;
2093 template<
typename _H2,
typename _P2>
2097 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
2102 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
2103 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
2106 template<
typename _H2,
typename _P2>
2111 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
2112 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
2115 template<
typename _H2,
typename _P2>
2120 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
2121 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
2124 template<
typename _H2,
typename _P2>
2127 { merge(__source); }
2128 #endif // node_extract 2136 {
return _M_h.hash_function(); }
2142 {
return _M_h.key_eq(); }
2160 {
return _M_h.find(__x); }
2162 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 2163 template<
typename _Kt>
2165 find(
const _Kt& __x) -> decltype(_M_h._M_find_tr(__x))
2166 {
return _M_h._M_find_tr(__x); }
2171 {
return _M_h.find(__x); }
2173 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 2174 template<
typename _Kt>
2176 find(
const _Kt& __x)
const -> decltype(_M_h._M_find_tr(__x))
2177 {
return _M_h._M_find_tr(__x); }
2189 {
return _M_h.count(__x); }
2191 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 2192 template<
typename _Kt>
2194 count(
const _Kt& __x)
const -> decltype(_M_h._M_count_tr(__x))
2195 {
return _M_h._M_count_tr(__x); }
2199 #if __cplusplus > 201703L 2208 {
return _M_h.find(__x) != _M_h.end(); }
2210 template<
typename _Kt>
2213 -> decltype(_M_h._M_find_tr(__x), void(),
true)
2214 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
2227 {
return _M_h.equal_range(__x); }
2229 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 2230 template<
typename _Kt>
2233 -> decltype(_M_h._M_equal_range_tr(__x))
2234 {
return _M_h._M_equal_range_tr(__x); }
2239 {
return _M_h.equal_range(__x); }
2241 #ifdef __glibcxx_generic_unordered_lookup // C++ >= 20 && HOSTED 2242 template<
typename _Kt>
2245 -> decltype(_M_h._M_equal_range_tr(__x))
2246 {
return _M_h._M_equal_range_tr(__x); }
2255 {
return _M_h.bucket_count(); }
2260 {
return _M_h.max_bucket_count(); }
2268 bucket_size(size_type __n)
const 2269 {
return _M_h.bucket_size(__n); }
2278 bucket(
const key_type& __key)
const 2279 {
return _M_h.bucket(__key); }
2281 #ifdef __glibcxx_associative_heterogeneous_insertion // C++26 2282 template <__heterogeneous_hash_key<unordered_multimap> _Kt>
2284 bucket(
const _Kt& __key)
const 2285 {
return _M_h._M_bucket_tr(__key); }
2297 {
return _M_h.begin(__n); }
2306 const_local_iterator
2308 {
return _M_h.begin(__n); }
2310 const_local_iterator
2312 {
return _M_h.cbegin(__n); }
2323 {
return _M_h.end(__n); }
2332 const_local_iterator
2334 {
return _M_h.end(__n); }
2336 const_local_iterator
2338 {
return _M_h.cend(__n); }
2346 {
return _M_h.load_factor(); }
2352 {
return _M_h.max_load_factor(); }
2360 { _M_h.max_load_factor(__z); }
2371 { _M_h.rehash(__n); }
2382 { _M_h.reserve(__n); }
2384 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
2388 _Hash1, _Pred1, _Alloc1>&,
2390 _Hash1, _Pred1, _Alloc1>&);
2393 #if __cpp_deduction_guides >= 201606 2395 template<
typename _InputIterator,
2396 typename _Hash = hash<__iter_key_t<_InputIterator>>,
2397 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
2399 typename = _RequireInputIter<_InputIterator>,
2400 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2401 typename = _RequireNotAllocator<_Pred>,
2402 typename = _RequireAllocator<_Allocator>>
2405 _Hash = _Hash(), _Pred = _Pred(),
2406 _Allocator = _Allocator())
2408 __iter_val_t<_InputIterator>, _Hash, _Pred,
2411 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
2412 typename _Pred = equal_to<_Key>,
2413 typename _Allocator = allocator<pair<const _Key, _Tp>>,
2414 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2415 typename = _RequireNotAllocator<_Pred>,
2416 typename = _RequireAllocator<_Allocator>>
2419 _Hash = _Hash(), _Pred = _Pred(),
2420 _Allocator = _Allocator())
2423 template<
typename _InputIterator,
typename _Allocator,
2424 typename = _RequireInputIter<_InputIterator>,
2425 typename = _RequireAllocator<_Allocator>>
2429 __iter_val_t<_InputIterator>,
2430 hash<__iter_key_t<_InputIterator>>,
2431 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2433 template<
typename _InputIterator,
typename _Allocator,
2434 typename = _RequireInputIter<_InputIterator>,
2435 typename = _RequireAllocator<_Allocator>>
2438 __iter_val_t<_InputIterator>,
2439 hash<__iter_key_t<_InputIterator>>,
2440 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2442 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
2443 typename = _RequireInputIter<_InputIterator>,
2444 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2445 typename = _RequireAllocator<_Allocator>>
2450 __iter_val_t<_InputIterator>, _Hash,
2451 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2453 template<
typename _Key,
typename _Tp,
typename _Allocator,
2454 typename = _RequireAllocator<_Allocator>>
2460 template<
typename _Key,
typename _Tp,
typename _Allocator,
2461 typename = _RequireAllocator<_Allocator>>
2465 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
2466 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2467 typename = _RequireAllocator<_Allocator>>
2473 #if __glibcxx_containers_ranges // C++ >= 23 2474 template<ranges::input_range _Rg,
2475 __not_allocator_like _Hash = hash<__detail::__range_key_type<_Rg>>,
2476 __not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>,
2477 __allocator_like _Allocator =
2481 _Hash = _Hash(), _Pred = _Pred(),
2482 _Allocator = _Allocator())
2484 __detail::__range_mapped_type<_Rg>,
2485 _Hash, _Pred, _Allocator>;
2487 template<ranges::input_range _Rg,
2488 __allocator_like _Allocator>
2492 __detail::__range_mapped_type<_Rg>,
2493 hash<__detail::__range_key_type<_Rg>>,
2494 equal_to<__detail::__range_key_type<_Rg>>,
2497 template<ranges::input_range _Rg,
2498 __allocator_like _Allocator>
2501 __detail::__range_mapped_type<_Rg>,
2502 hash<__detail::__range_key_type<_Rg>>,
2503 equal_to<__detail::__range_key_type<_Rg>>,
2506 template<ranges::input_range _Rg,
2507 __not_allocator_like _Hash,
2508 __allocator_like _Allocator>
2513 __detail::__range_mapped_type<_Rg>,
2514 _Hash, equal_to<__detail::__range_key_type<_Rg>>,
2519 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2523 noexcept(noexcept(__x.
swap(__y)))
2526 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2530 noexcept(noexcept(__x.
swap(__y)))
2533 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2537 {
return __x._M_h._M_equal(__y._M_h); }
2539 #if __cpp_impl_three_way_comparison < 201907L 2540 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2544 {
return !(__x == __y); }
2547 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2551 {
return __x._M_h._M_equal(__y._M_h); }
2553 #if __cpp_impl_three_way_comparison < 201907L 2554 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2558 {
return !(__x == __y); }
2561 _GLIBCXX_END_NAMESPACE_CONTAINER
2563 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED 2565 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2566 typename _Alloc,
typename _Hash2,
typename _Eq2>
2567 struct _Hash_merge_helper<
2568 _GLIBCXX_STD_C::
unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2572 template<
typename... _Tp>
2573 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2574 template<
typename... _Tp>
2581 {
return __map._M_h; }
2585 {
return __map._M_h; }
2589 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2590 typename _Alloc,
typename _Hash2,
typename _Eq2>
2591 struct _Hash_merge_helper<
2596 template<
typename... _Tp>
2597 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2598 template<
typename... _Tp>
2605 {
return __map._M_h; }
2609 {
return __map._M_h; }
2611 #endif // node_extract 2613 _GLIBCXX_END_NAMESPACE_VERSION
_Hashtable::hasher hasher
Public typedefs.
auto find(const _Kt &__x) -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_map.
const_iterator cbegin() const noexcept
iterator find(const key_type &__x)
Tries to locate an element in an unordered_map.
void reserve(size_type __n)
Prepare the unordered_map for a specified number of elements.
auto contains(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x), void(), true)
Finds whether an element with the given key exists.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(_Pair &&__x)
Inserts a std::pair into the unordered_multimap.
iterator emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
auto equal_range(const _Kt &__x) const -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_map.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_multimap.
size_type count(const key_type &__x) const
Finds the number of elements.
void max_load_factor(float __z)
Change the unordered_multimap maximum load factor.
_Hashtable::key_type key_type
Public typedefs.
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
iterator insert_or_assign(const_iterator __hint, const key_type &__k, _Obj &&__obj)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::reference reference
Iterator-related typedefs.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_map.
iterator begin() noexcept
float max_load_factor() const noexcept
Returns a positive number that the unordered_map tries to keep the load factor less than or equal to...
unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_multimap from a range.
std::pair< iterator, bool > emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
iterator insert(node_type &&__nh)
Re-insert an extracted node.
float load_factor() const noexcept
Returns the average number of elements per bucket.
_Hashtable::mapped_type mapped_type
Public typedefs.
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(const_iterator __hint, _Pair &&__x)
Inserts a std::pair into the unordered_multimap.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
auto find(const _Kt &__x) -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_multimap.
iterator erase(const_iterator __position)
Erases an element from an unordered_multimap.
const_iterator end() const noexcept
unordered_map(initializer_list< value_type > __l, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_map from an initializer_list.
iterator try_emplace(const_iterator __hint, const key_type &__k, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
iterator insert(const_iterator, node_type &&__nh)
Re-insert an extracted node.
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
iterator try_emplace(const_iterator __hint, key_type &&__k, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
float max_load_factor() const noexcept
Returns a positive number that the unordered_multimap tries to keep the load factor less than or equa...
A standard container composed of unique keys (containing at most one of each key value) that associat...
mapped_type & at(const key_type &__k)
Access to unordered_map data.
mapped_type & operator[](const key_type &__k)
Subscript ( [] ) access to unordered_map data.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multimap.
node_type extract(const key_type &__key)
Extract a node.
auto equal_range(const _Kt &__x) const -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
unordered_multimap(const allocator_type &__a)
Creates an unordered_multimap with no elements.
__detail::_Hashtable_traits< _Cache, false, true > __umap_traits
Base types for unordered_map.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_multimap.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_map.
insert_return_type insert(node_type &&__nh)
Re-insert an extracted node.
unordered_multimap & operator=(initializer_list< value_type > __l)
Unordered_multimap list assignment operator.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_map.
const_iterator begin() const noexcept
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_multimap.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
_Hashtable::pointer pointer
Iterator-related typedefs.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
const_iterator end() const noexcept
iterator insert(value_type &&__x)
Inserts a std::pair into the unordered_multimap.
iterator insert(const_iterator __hint, const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
hasher hash_function() const
Returns the hash functor object with which the unordered_map was constructed.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_map.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
unordered_map & operator=(const unordered_map &)=default
Copy assignment operator.
node_type extract(const_iterator __pos)
Extract a node.
_Hashtable::size_type size_type
Iterator-related typedefs.
_Hashtable::size_type size_type
Iterator-related typedefs.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
unordered_map(_InputIterator __first, _InputIterator __last, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_map from a range.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_multimap.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
bool empty() const noexcept
Returns true if the unordered_multimap is empty.
size_type max_size() const noexcept
Returns the maximum size of the unordered_map.
bool empty() const noexcept
Returns true if the unordered_map is empty.
__detail::_Hashtable_traits< _Cache, false, false > __ummap_traits
Base types for unordered_multimap.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
ISO C++ entities toplevel namespace is std.
_Hashtable::pointer pointer
Iterator-related typedefs.
_Hashtable::iterator iterator
Iterator-related typedefs.
_Hashtable::key_type key_type
Public typedefs.
iterator erase(const_iterator __position)
Erases an element from an unordered_map.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
auto find(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_map.
void max_load_factor(float __z)
Change the unordered_map maximum load factor.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
_Hashtable::reference reference
Iterator-related typedefs.
iterator begin() noexcept
iterator insert_or_assign(const_iterator __hint, key_type &&__k, _Obj &&__obj)
Attempts to insert a std::pair into the unordered_map.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
A standard container composed of equivalent keys (possibly containing multiple of each key value) tha...
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
Struct holding two objects of arbitrary type.
void swap(unordered_multimap &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_multimap.
_Hashtable::hasher hasher
Public typedefs.
_Hashtable::key_equal key_equal
Public typedefs.
iterator insert(const_iterator __hint, const value_type &__x)
Inserts a std::pair into the unordered_multimap.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
size_type count(const key_type &__x) const
Finds the number of elements.
const_iterator cend() const noexcept
auto find(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_multimap.
size_type size() const noexcept
Returns the size of the unordered_multimap.
hasher hash_function() const
Returns the hash functor object with which the unordered_multimap was constructed.
_Hashtable::allocator_type allocator_type
Public typedefs.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(const_iterator __hint, _Pair &&__x)
Attempts to insert a std::pair into the unordered_map.
auto contains(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x), void(), true)
Finds whether an element with the given key exists.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
iterator erase(iterator __position)
Erases an element from an unordered_multimap.
void rehash(size_type __n)
May rehash the unordered_map.
unordered_map(const allocator_type &__a)
Creates an unordered_map with no elements.
_Hashtable::iterator iterator
Iterator-related typedefs.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multimap.
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
iterator insert(const_iterator __hint, value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
unordered_multimap(size_type __n, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Default constructor creates no elements.
iterator insert(const value_type &__x)
Inserts a std::pair into the unordered_multimap.
key_equal key_eq() const
Returns the key comparison object with which the unordered_map was constructed.
auto equal_range(const _Kt &__x) -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
void reserve(size_type __n)
Prepare the unordered_multimap for a specified number of elements.
node_type extract(const key_type &__key)
Extract a node.
_Hashtable::allocator_type allocator_type
Public typedefs.
const_iterator begin() const noexcept
pair< iterator, bool > try_emplace(key_type &&__k, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
node_type extract(const_iterator __pos)
Extract a node.
void rehash(size_type __n)
May rehash the unordered_multimap.
_Hashtable::value_type value_type
Public typedefs.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
The standard allocator, as per C++03 [20.4.1].
Primary class template hash.
pair< iterator, bool > insert_or_assign(key_type &&__k, _Obj &&__obj)
Attempts to insert a std::pair into the unordered_map.
unordered_map()=default
Default constructor.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
size_type max_size() const noexcept
Returns the maximum size of the unordered_multimap.
unordered_map & operator=(initializer_list< value_type > __l)
Unordered_map list assignment operator.
pair< iterator, bool > try_emplace(const key_type &__k, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
iterator insert(const_iterator __hint, node_type &&__nh)
Re-insert an extracted node.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
One of the comparison functors.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
const_iterator cend() const noexcept
_Hashtable::key_equal key_equal
Public typedefs.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
void swap(unordered_map &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_map.
key_equal key_eq() const
Returns the key comparison object with which the unordered_multimap was constructed.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
pair< iterator, bool > insert_or_assign(const key_type &__k, _Obj &&__obj)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::value_type value_type
Public typedefs.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
unordered_map(size_type __n, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Default constructor creates no elements.
const_iterator cbegin() const noexcept
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_map.
__enable_if_t< is_constructible< value_type, _Pair && >::value, pair< iterator, bool > > insert(_Pair &&__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
float load_factor() const noexcept
Returns the average number of elements per bucket.
iterator insert(const_iterator __hint, value_type &&__x)
Inserts a std::pair into the unordered_multimap.
auto equal_range(const _Kt &__x) -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
unordered_multimap(initializer_list< value_type > __l, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_multimap from an initializer_list.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
auto count(const _Kt &__x) const -> decltype(_M_h._M_count_tr(__x))
Finds the number of elements.
iterator erase(iterator __position)
Erases an element from an unordered_map.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
const mapped_type & at(const key_type &__k) const
Access to unordered_map data.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
_Hashtable::mapped_type mapped_type
Public typedefs.
auto count(const _Kt &__x) const -> decltype(_M_h._M_count_tr(__x))
Finds the number of elements.
mapped_type & operator[](key_type &&__k)
Subscript ( [] ) access to unordered_map data.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_multimap.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
size_type size() const noexcept
Returns the size of the unordered_map.