30#ifndef _UNORDERED_MAP_H
31#define _UNORDERED_MAP_H
37#if __glibcxx_ranges_to_container
41namespace 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
144 using node_type =
typename _Hashtable::node_type;
145 using insert_return_type =
typename _Hashtable::insert_return_type;
165 : _M_h(__n, __hf, __eql, __a)
181 template<
typename _InputIterator>
187 : _M_h(__first, __last, __n, __hf, __eql, __a)
212 : _M_h(__umap._M_h, __a)
222 noexcept(
noexcept(_Hashtable(
std::move(__umap._M_h), __a)) )
242 : _M_h(__l, __n, __hf, __eql, __a)
254 template<
typename _InputIterator>
261 template<
typename _InputIterator>
280#if __glibcxx_ranges_to_container
294 template<__detail::__container_compatible_range<value_type> _Rg>
300 : _M_h(__n, __hf, __eql, __a)
301 { insert_range(std::forward<_Rg>(__rg)); }
303 template<__detail::__container_compatible_range<value_type> _Rg>
307 { insert_range(std::forward<_Rg>(__rg)); }
309 template<__detail::__container_compatible_range<value_type> _Rg>
313 { insert_range(std::forward<_Rg>(__rg)); }
345 {
return _M_h.get_allocator(); }
350 _GLIBCXX_NODISCARD
bool
352 {
return _M_h.empty(); }
357 {
return _M_h.size(); }
362 {
return _M_h.max_size(); }
372 {
return _M_h.begin(); }
381 {
return _M_h.begin(); }
385 {
return _M_h.begin(); }
394 {
return _M_h.end(); }
403 {
return _M_h.end(); }
407 {
return _M_h.end(); }
432 template<
typename... _Args>
435 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
463 template<
typename... _Args>
466 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
468#ifdef __glibcxx_node_extract
473 __glibcxx_assert(__pos !=
end());
474 return _M_h.extract(__pos);
480 {
return _M_h.extract(__key); }
485 {
return _M_h._M_reinsert_node(
std::move(__nh)); }
490 {
return _M_h._M_reinsert_node(
std::move(__nh)).position; }
493#ifdef __glibcxx_unordered_map_try_emplace
516 template <
typename... _Args>
520 return _M_h.try_emplace(
cend(), __k, std::forward<_Args>(__args)...);
524 template <
typename... _Args>
529 std::forward<_Args>(__args)...);
560 template <
typename... _Args>
565 return _M_h.try_emplace(__hint, __k,
566 std::forward<_Args>(__args)...).first;
570 template <
typename... _Args>
574 return _M_h.try_emplace(__hint,
std::move(__k),
575 std::forward<_Args>(__args)...).first;
599 {
return _M_h.insert(__x); }
607 template<
typename _Pair>
608 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
611 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
638 {
return _M_h.insert(__hint, __x); }
644 {
return _M_h.insert(__hint,
std::move(__x)); }
646 template<
typename _Pair>
647 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
649 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
661 template<
typename _InputIterator>
663 insert(_InputIterator __first, _InputIterator __last)
664 { _M_h.insert(__first, __last); }
675 { _M_h.insert(__l); }
677#if __glibcxx_ranges_to_container
684 template<__detail::__container_compatible_range<value_type> _Rg>
686 insert_range(_Rg&& __rg)
688 auto __first = ranges::begin(__rg);
689 const auto __last = ranges::end(__rg);
690 for (; __first != __last; ++__first)
691 _M_h.emplace(*__first);
695#ifdef __glibcxx_unordered_map_try_emplace
716 template <
typename _Obj>
720 auto __ret = _M_h.try_emplace(
cend(), __k,
721 std::forward<_Obj>(__obj));
723 __ret.first->second = std::forward<_Obj>(__obj);
728 template <
typename _Obj>
733 std::forward<_Obj>(__obj));
735 __ret.
first->second = std::forward<_Obj>(__obj);
765 template <
typename _Obj>
770 auto __ret = _M_h.try_emplace(__hint, __k, std::forward<_Obj>(__obj));
772 __ret.first->second = std::forward<_Obj>(__obj);
777 template <
typename _Obj>
781 auto __ret = _M_h.try_emplace(__hint,
std::move(__k),
782 std::forward<_Obj>(__obj));
784 __ret.first->second = std::forward<_Obj>(__obj);
805 {
return _M_h.erase(__position); }
810 {
return _M_h.erase(__position); }
827 {
return _M_h.erase(__x); }
845 {
return _M_h.erase(__first, __last); }
869 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
870 { _M_h.swap(__x._M_h); }
872#ifdef __glibcxx_node_extract
873 template<
typename,
typename,
typename>
874 friend class std::_Hash_merge_helper;
876 template<
typename _H2,
typename _P2>
880 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
884 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
885 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
888 template<
typename _H2,
typename _P2>
890 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
892 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
893 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
896 template<
typename _H2,
typename _P2>
898 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
900 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
901 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
904 template<
typename _H2,
typename _P2>
906 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
916 {
return _M_h.hash_function(); }
922 {
return _M_h.key_eq(); }
940 {
return _M_h.find(__x); }
942#if __cplusplus > 201703L
943 template<
typename _Kt>
945 find(
const _Kt& __x) ->
decltype(_M_h._M_find_tr(__x))
946 {
return _M_h._M_find_tr(__x); }
951 {
return _M_h.find(__x); }
953#if __cplusplus > 201703L
954 template<
typename _Kt>
956 find(
const _Kt& __x)
const ->
decltype(_M_h._M_find_tr(__x))
957 {
return _M_h._M_find_tr(__x); }
973 {
return _M_h.count(__x); }
975#if __cplusplus > 201703L
976 template<
typename _Kt>
978 count(
const _Kt& __x)
const ->
decltype(_M_h._M_count_tr(__x))
979 {
return _M_h._M_count_tr(__x); }
983#if __cplusplus > 201703L
992 {
return _M_h.find(__x) != _M_h.end(); }
994 template<
typename _Kt>
997 ->
decltype(_M_h._M_find_tr(__x), void(),
true)
998 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
1013 {
return _M_h.equal_range(__x); }
1015#if __cplusplus > 201703L
1016 template<
typename _Kt>
1019 ->
decltype(_M_h._M_equal_range_tr(__x))
1020 {
return _M_h._M_equal_range_tr(__x); }
1025 {
return _M_h.equal_range(__x); }
1027#if __cplusplus > 201703L
1028 template<
typename _Kt>
1031 ->
decltype(_M_h._M_equal_range_tr(__x))
1032 {
return _M_h._M_equal_range_tr(__x); }
1051 {
return _M_h[__k]; }
1068 {
return _M_h.at(__k); }
1072 {
return _M_h.at(__k); }
1080 {
return _M_h.bucket_count(); }
1085 {
return _M_h.max_bucket_count(); }
1094 {
return _M_h.bucket_size(__n); }
1102 bucket(
const key_type& __key)
const
1103 {
return _M_h.bucket(__key); }
1113 {
return _M_h.begin(__n); }
1124 {
return _M_h.begin(__n); }
1128 {
return _M_h.cbegin(__n); }
1139 {
return _M_h.end(__n); }
1150 {
return _M_h.end(__n); }
1154 {
return _M_h.cend(__n); }
1162 {
return _M_h.load_factor(); }
1168 {
return _M_h.max_load_factor(); }
1176 { _M_h.max_load_factor(__z); }
1187 { _M_h.rehash(__n); }
1198 { _M_h.reserve(__n); }
1200 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1207#if __cpp_deduction_guides >= 201606
1209 template<
typename _InputIterator,
1210 typename _Hash = hash<__iter_key_t<_InputIterator>>,
1211 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
1212 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
1213 typename = _RequireInputIter<_InputIterator>,
1214 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1215 typename = _RequireNotAllocator<_Pred>,
1216 typename = _RequireAllocator<_Allocator>>
1217 unordered_map(_InputIterator, _InputIterator,
1219 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1220 -> unordered_map<__iter_key_t<_InputIterator>,
1221 __iter_val_t<_InputIterator>,
1222 _Hash, _Pred, _Allocator>;
1224 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1225 typename _Pred = equal_to<_Key>,
1226 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1227 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1228 typename = _RequireNotAllocator<_Pred>,
1229 typename = _RequireAllocator<_Allocator>>
1230 unordered_map(initializer_list<pair<_Key, _Tp>>,
1232 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1233 -> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
1235 template<
typename _InputIterator,
typename _Allocator,
1236 typename = _RequireInputIter<_InputIterator>,
1237 typename = _RequireAllocator<_Allocator>>
1238 unordered_map(_InputIterator, _InputIterator,
1240 -> unordered_map<__iter_key_t<_InputIterator>,
1241 __iter_val_t<_InputIterator>,
1242 hash<__iter_key_t<_InputIterator>>,
1243 equal_to<__iter_key_t<_InputIterator>>,
1246 template<
typename _InputIterator,
typename _Allocator,
1247 typename = _RequireInputIter<_InputIterator>,
1248 typename = _RequireAllocator<_Allocator>>
1249 unordered_map(_InputIterator, _InputIterator, _Allocator)
1250 -> unordered_map<__iter_key_t<_InputIterator>,
1251 __iter_val_t<_InputIterator>,
1252 hash<__iter_key_t<_InputIterator>>,
1253 equal_to<__iter_key_t<_InputIterator>>,
1256 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1257 typename = _RequireInputIter<_InputIterator>,
1258 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1259 typename = _RequireAllocator<_Allocator>>
1260 unordered_map(_InputIterator, _InputIterator,
1263 -> unordered_map<__iter_key_t<_InputIterator>,
1264 __iter_val_t<_InputIterator>, _Hash,
1265 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1267 template<
typename _Key,
typename _Tp,
typename _Allocator,
1268 typename = _RequireAllocator<_Allocator>>
1269 unordered_map(initializer_list<pair<_Key, _Tp>>,
1272 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1274 template<
typename _Key,
typename _Tp,
typename _Allocator,
1275 typename = _RequireAllocator<_Allocator>>
1276 unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
1277 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1279 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1280 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1281 typename = _RequireAllocator<_Allocator>>
1282 unordered_map(initializer_list<pair<_Key, _Tp>>,
1285 -> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
1287#if __glibcxx_ranges_to_container
1288 template<ranges::input_range _Rg,
1289 __not_allocator_like _Hash = hash<__detail::__range_key_type<_Rg>>,
1290 __not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>,
1291 __allocator_like _Allocator =
1292 allocator<__detail::__range_to_alloc_type<_Rg>>>
1294 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1295 -> unordered_map<__detail::__range_key_type<_Rg>,
1296 __detail::__range_mapped_type<_Rg>,
1297 _Hash, _Pred, _Allocator>;
1299 template<ranges::input_range _Rg,
1300 __allocator_like _Allocator>
1303 -> unordered_map<__detail::__range_key_type<_Rg>,
1304 __detail::__range_mapped_type<_Rg>,
1305 hash<__detail::__range_key_type<_Rg>>,
1306 equal_to<__detail::__range_key_type<_Rg>>,
1309 template<ranges::input_range _Rg,
1310 __allocator_like _Allocator>
1311 unordered_map(from_range_t, _Rg&&, _Allocator)
1312 -> unordered_map<__detail::__range_key_type<_Rg>,
1313 __detail::__range_mapped_type<_Rg>,
1314 hash<__detail::__range_key_type<_Rg>>,
1315 equal_to<__detail::__range_key_type<_Rg>>,
1318 template<ranges::input_range _Rg,
1319 __not_allocator_like _Hash,
1320 __allocator_like _Allocator>
1323 -> unordered_map<__detail::__range_key_type<_Rg>,
1324 __detail::__range_mapped_type<_Rg>,
1325 _Hash, equal_to<__detail::__range_key_type<_Rg>>,
1355 template<
typename _Key,
typename _Tp,
1356 typename _Hash = hash<_Key>,
1357 typename _Pred = equal_to<_Key>,
1358 typename _Alloc = allocator<std::pair<const _Key, _Tp>>>
1361 typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
1390#ifdef __glibcxx_node_extract
1391 using node_type =
typename _Hashtable::node_type;
1411 : _M_h(__n, __hf, __eql, __a)
1427 template<
typename _InputIterator>
1433 : _M_h(__first, __last, __n, __hf, __eql, __a)
1458 : _M_h(__ummap._M_h, __a)
1468 noexcept(
noexcept(_Hashtable(
std::move(__ummap._M_h), __a)) )
1488 : _M_h(__l, __n, __hf, __eql, __a)
1500 template<
typename _InputIterator>
1507 template<
typename _InputIterator>
1526#if __glibcxx_ranges_to_container
1540 template<__detail::__container_compatible_range<value_type> _Rg>
1546 : _M_h(__n, __hf, __eql, __a)
1547 { insert_range(std::forward<_Rg>(__rg)); }
1549 template<__detail::__container_compatible_range<value_type> _Rg>
1553 { insert_range(std::forward<_Rg>(__rg)); }
1555 template<__detail::__container_compatible_range<value_type> _Rg>
1559 { insert_range(std::forward<_Rg>(__rg)); }
1591 {
return _M_h.get_allocator(); }
1596 _GLIBCXX_NODISCARD
bool
1598 {
return _M_h.empty(); }
1603 {
return _M_h.size(); }
1608 {
return _M_h.max_size(); }
1618 {
return _M_h.begin(); }
1627 {
return _M_h.begin(); }
1631 {
return _M_h.begin(); }
1640 {
return _M_h.end(); }
1649 {
return _M_h.end(); }
1653 {
return _M_h.end(); }
1673 template<
typename... _Args>
1676 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1700 template<
typename... _Args>
1703 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1717 {
return _M_h.insert(__x); }
1723 template<
typename _Pair>
1724 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1726 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
1751 {
return _M_h.insert(__hint, __x); }
1757 {
return _M_h.insert(__hint,
std::move(__x)); }
1759 template<
typename _Pair>
1760 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1762 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
1774 template<
typename _InputIterator>
1776 insert(_InputIterator __first, _InputIterator __last)
1777 { _M_h.insert(__first, __last); }
1789 { _M_h.insert(__l); }
1791#if __glibcxx_ranges_to_container
1798 template<__detail::__container_compatible_range<value_type> _Rg>
1800 insert_range(_Rg&& __rg)
1802 auto __first = ranges::begin(__rg);
1803 const auto __last = ranges::end(__rg);
1804 if (__first == __last)
1807 if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
1808 _M_h._M_rehash_insert(ranges::distance(__rg));
1810 _M_h._M_rehash_insert(1);
1812 for (; __first != __last; ++__first)
1813 _M_h.emplace(*__first);
1817#ifdef __glibcxx_node_extract
1822 __glibcxx_assert(__pos !=
end());
1823 return _M_h.extract(__pos);
1829 {
return _M_h.extract(__key); }
1834 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1839 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1858 {
return _M_h.erase(__position); }
1863 {
return _M_h.erase(__position); }
1879 {
return _M_h.erase(__x); }
1898 {
return _M_h.erase(__first, __last); }
1922 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
1923 { _M_h.swap(__x._M_h); }
1925#ifdef __glibcxx_node_extract
1926 template<
typename,
typename,
typename>
1927 friend class std::_Hash_merge_helper;
1929 template<
typename _H2,
typename _P2>
1933 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
1938 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1939 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1942 template<
typename _H2,
typename _P2>
1944 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1947 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1948 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1951 template<
typename _H2,
typename _P2>
1953 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
1956 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1957 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1960 template<
typename _H2,
typename _P2>
1962 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1963 { merge(__source); }
1972 {
return _M_h.hash_function(); }
1978 {
return _M_h.key_eq(); }
1996 {
return _M_h.find(__x); }
1998#if __cplusplus > 201703L
1999 template<
typename _Kt>
2001 find(
const _Kt& __x) ->
decltype(_M_h._M_find_tr(__x))
2002 {
return _M_h._M_find_tr(__x); }
2007 {
return _M_h.find(__x); }
2009#if __cplusplus > 201703L
2010 template<
typename _Kt>
2012 find(
const _Kt& __x)
const ->
decltype(_M_h._M_find_tr(__x))
2013 {
return _M_h._M_find_tr(__x); }
2025 {
return _M_h.count(__x); }
2027#if __cplusplus > 201703L
2028 template<
typename _Kt>
2030 count(
const _Kt& __x)
const ->
decltype(_M_h._M_count_tr(__x))
2031 {
return _M_h._M_count_tr(__x); }
2035#if __cplusplus > 201703L
2044 {
return _M_h.find(__x) != _M_h.end(); }
2046 template<
typename _Kt>
2049 ->
decltype(_M_h._M_find_tr(__x), void(),
true)
2050 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
2063 {
return _M_h.equal_range(__x); }
2065#if __cplusplus > 201703L
2066 template<
typename _Kt>
2069 ->
decltype(_M_h._M_equal_range_tr(__x))
2070 {
return _M_h._M_equal_range_tr(__x); }
2075 {
return _M_h.equal_range(__x); }
2077#if __cplusplus > 201703L
2078 template<
typename _Kt>
2081 ->
decltype(_M_h._M_equal_range_tr(__x))
2082 {
return _M_h._M_equal_range_tr(__x); }
2091 {
return _M_h.bucket_count(); }
2096 {
return _M_h.max_bucket_count(); }
2105 {
return _M_h.bucket_size(__n); }
2113 bucket(
const key_type& __key)
const
2114 {
return _M_h.bucket(__key); }
2124 {
return _M_h.begin(__n); }
2135 {
return _M_h.begin(__n); }
2139 {
return _M_h.cbegin(__n); }
2150 {
return _M_h.end(__n); }
2161 {
return _M_h.end(__n); }
2165 {
return _M_h.cend(__n); }
2173 {
return _M_h.load_factor(); }
2179 {
return _M_h.max_load_factor(); }
2187 { _M_h.max_load_factor(__z); }
2198 { _M_h.rehash(__n); }
2209 { _M_h.reserve(__n); }
2211 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
2215 _Hash1, _Pred1, _Alloc1>&,
2217 _Hash1, _Pred1, _Alloc1>&);
2220#if __cpp_deduction_guides >= 201606
2222 template<
typename _InputIterator,
2223 typename _Hash = hash<__iter_key_t<_InputIterator>>,
2224 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
2225 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
2226 typename = _RequireInputIter<_InputIterator>,
2227 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2228 typename = _RequireNotAllocator<_Pred>,
2229 typename = _RequireAllocator<_Allocator>>
2230 unordered_multimap(_InputIterator, _InputIterator,
2232 _Hash = _Hash(), _Pred = _Pred(),
2233 _Allocator = _Allocator())
2234 -> unordered_multimap<__iter_key_t<_InputIterator>,
2235 __iter_val_t<_InputIterator>, _Hash, _Pred,
2238 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
2239 typename _Pred = equal_to<_Key>,
2240 typename _Allocator = allocator<pair<const _Key, _Tp>>,
2241 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2242 typename = _RequireNotAllocator<_Pred>,
2243 typename = _RequireAllocator<_Allocator>>
2244 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2246 _Hash = _Hash(), _Pred = _Pred(),
2247 _Allocator = _Allocator())
2248 -> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
2250 template<
typename _InputIterator,
typename _Allocator,
2251 typename = _RequireInputIter<_InputIterator>,
2252 typename = _RequireAllocator<_Allocator>>
2253 unordered_multimap(_InputIterator, _InputIterator,
2255 -> unordered_multimap<__iter_key_t<_InputIterator>,
2256 __iter_val_t<_InputIterator>,
2257 hash<__iter_key_t<_InputIterator>>,
2258 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2260 template<
typename _InputIterator,
typename _Allocator,
2261 typename = _RequireInputIter<_InputIterator>,
2262 typename = _RequireAllocator<_Allocator>>
2263 unordered_multimap(_InputIterator, _InputIterator, _Allocator)
2264 -> unordered_multimap<__iter_key_t<_InputIterator>,
2265 __iter_val_t<_InputIterator>,
2266 hash<__iter_key_t<_InputIterator>>,
2267 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2269 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
2270 typename = _RequireInputIter<_InputIterator>,
2271 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2272 typename = _RequireAllocator<_Allocator>>
2273 unordered_multimap(_InputIterator, _InputIterator,
2276 -> unordered_multimap<__iter_key_t<_InputIterator>,
2277 __iter_val_t<_InputIterator>, _Hash,
2278 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2280 template<
typename _Key,
typename _Tp,
typename _Allocator,
2281 typename = _RequireAllocator<_Allocator>>
2282 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2285 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2287 template<
typename _Key,
typename _Tp,
typename _Allocator,
2288 typename = _RequireAllocator<_Allocator>>
2289 unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
2290 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2292 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
2293 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2294 typename = _RequireAllocator<_Allocator>>
2295 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2298 -> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
2300#if __glibcxx_ranges_to_container
2301 template<ranges::input_range _Rg,
2302 __not_allocator_like _Hash = hash<__detail::__range_key_type<_Rg>>,
2303 __not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>,
2304 __allocator_like _Allocator =
2305 allocator<__detail::__range_to_alloc_type<_Rg>>>
2306 unordered_multimap(from_range_t, _Rg&&,
2308 _Hash = _Hash(), _Pred = _Pred(),
2309 _Allocator = _Allocator())
2310 -> unordered_multimap<__detail::__range_key_type<_Rg>,
2311 __detail::__range_mapped_type<_Rg>,
2312 _Hash, _Pred, _Allocator>;
2314 template<ranges::input_range _Rg,
2315 __allocator_like _Allocator>
2318 -> unordered_multimap<__detail::__range_key_type<_Rg>,
2319 __detail::__range_mapped_type<_Rg>,
2320 hash<__detail::__range_key_type<_Rg>>,
2321 equal_to<__detail::__range_key_type<_Rg>>,
2324 template<ranges::input_range _Rg,
2325 __allocator_like _Allocator>
2326 unordered_multimap(from_range_t, _Rg&&, _Allocator)
2327 -> unordered_multimap<__detail::__range_key_type<_Rg>,
2328 __detail::__range_mapped_type<_Rg>,
2329 hash<__detail::__range_key_type<_Rg>>,
2330 equal_to<__detail::__range_key_type<_Rg>>,
2333 template<ranges::input_range _Rg,
2334 __not_allocator_like _Hash,
2335 __allocator_like _Allocator>
2336 unordered_multimap(from_range_t, _Rg&&,
2339 -> unordered_multimap<__detail::__range_key_type<_Rg>,
2340 __detail::__range_mapped_type<_Rg>,
2341 _Hash, equal_to<__detail::__range_key_type<_Rg>>,
2346 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2348 swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2349 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2350 noexcept(
noexcept(__x.swap(__y)))
2353 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2355 swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2356 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2357 noexcept(
noexcept(__x.swap(__y)))
2360 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2362 operator==(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2363 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2364 {
return __x._M_h._M_equal(__y._M_h); }
2366#if __cpp_impl_three_way_comparison < 201907L
2367 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2369 operator!=(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2370 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2371 {
return !(__x == __y); }
2374 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2376 operator==(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2377 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2378 {
return __x._M_h._M_equal(__y._M_h); }
2380#if __cpp_impl_three_way_comparison < 201907L
2381 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2383 operator!=(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2384 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2385 {
return !(__x == __y); }
2388_GLIBCXX_END_NAMESPACE_CONTAINER
2390#ifdef __glibcxx_node_extract
2392 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2393 typename _Alloc,
typename _Hash2,
typename _Eq2>
2394 struct _Hash_merge_helper<
2395 _GLIBCXX_STD_C::unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2399 template<
typename... _Tp>
2400 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2401 template<
typename... _Tp>
2402 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2404 friend unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2407 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2408 {
return __map._M_h; }
2411 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2412 {
return __map._M_h; }
2416 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2417 typename _Alloc,
typename _Hash2,
typename _Eq2>
2418 struct _Hash_merge_helper<
2419 _GLIBCXX_STD_C::unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2423 template<
typename... _Tp>
2424 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2425 template<
typename... _Tp>
2426 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2428 friend unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2431 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2432 {
return __map._M_h; }
2435 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2436 {
return __map._M_h; }
2440_GLIBCXX_END_NAMESPACE_VERSION
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
ISO C++ entities toplevel namespace is std.
__detail::_Hashtable_traits< _Cache, false, false > __ummap_traits
Base types for unordered_multimap.
__detail::_Hashtable_traits< _Cache, false, true > __umap_traits
Base types for unordered_map.
Primary class template hash.
The standard allocator, as per C++03 [20.4.1].
One of the comparison functors.
Struct holding two objects of arbitrary type.
_T1 first
The first member.
A standard container composed of equivalent keys (possibly containing multiple of each key value) tha...
float load_factor() const noexcept
Returns the average number of elements per bucket.
_Hashtable::reference reference
Iterator-related typedefs.
iterator erase(iterator __position)
Erases an element from an unordered_multimap.
const_iterator end() const noexcept
size_type erase(const key_type &__x)
Erases elements according to the provided key.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_multimap.
_Hashtable::iterator iterator
Iterator-related typedefs.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multimap.
iterator begin() noexcept
const_iterator begin() const noexcept
hasher hash_function() const
Returns the hash functor object with which the unordered_multimap was constructed.
iterator insert(const_iterator __hint, node_type &&__nh)
Re-insert an extracted node.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(const_iterator __hint, _Pair &&__x)
Inserts a std::pair into the unordered_multimap.
unordered_multimap & operator=(const unordered_multimap &)=default
Copy assignment operator.
key_equal key_eq() const
Returns the key comparison object with which the unordered_multimap was constructed.
size_type count(const key_type &__x) const
Finds the number of elements.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_multimap.
_Hashtable::mapped_type mapped_type
Public typedefs.
auto find(const _Kt &__x) -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_multimap.
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
unordered_multimap & operator=(initializer_list< value_type > __l)
Unordered_multimap list assignment operator.
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.
_Hashtable::value_type value_type
Public typedefs.
iterator emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
node_type extract(const key_type &__key)
Extract a node.
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
iterator insert(node_type &&__nh)
Re-insert an extracted node.
iterator erase(const_iterator __position)
Erases an element from an unordered_multimap.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
float max_load_factor() const noexcept
Returns a positive number that the unordered_multimap tries to keep the load factor less than or equa...
unordered_multimap()=default
Default constructor.
iterator insert(value_type &&__x)
Inserts a std::pair into the unordered_multimap.
iterator insert(const value_type &__x)
Inserts a std::pair into the unordered_multimap.
unordered_multimap & operator=(unordered_multimap &&)=default
Move assignment operator.
_Hashtable::hasher hasher
Public typedefs.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
void reserve(size_type __n)
Prepare the unordered_multimap for a specified number of elements.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
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.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multimap.
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.
auto count(const _Kt &__x) const -> decltype(_M_h._M_count_tr(__x))
Finds the number of elements.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_multimap.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
_Hashtable::pointer pointer
Iterator-related typedefs.
_Hashtable::allocator_type allocator_type
Public typedefs.
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_multimap.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
unordered_multimap(unordered_multimap &&)=default
Move constructor.
unordered_multimap(const allocator_type &__a)
Creates an unordered_multimap with no elements.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
_Hashtable::size_type size_type
Iterator-related typedefs.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(_Pair &&__x)
Inserts a std::pair into the unordered_multimap.
auto contains(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x), void(), true)
Finds whether an element with the given key exists.
void swap(unordered_multimap &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_multimap.
void rehash(size_type __n)
May rehash the unordered_multimap.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_multimap.
const_iterator cend() const noexcept
size_type max_size() const noexcept
Returns the maximum size of the unordered_multimap.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
bool empty() const noexcept
Returns true if the unordered_multimap is empty.
const_iterator cbegin() const noexcept
_Hashtable::key_type key_type
Public typedefs.
node_type extract(const_iterator __pos)
Extract a node.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
iterator insert(const_iterator __hint, const value_type &__x)
Inserts a std::pair into the unordered_multimap.
size_type size() const noexcept
Returns the size of the unordered_multimap.
unordered_multimap(const unordered_multimap &)=default
Copy constructor.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
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.
_Hashtable::key_equal key_equal
Public typedefs.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_multimap.
void max_load_factor(float __z)
Change the unordered_multimap maximum load factor.
auto equal_range(const _Kt &__x) const -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
A standard container composed of unique keys (containing at most one of each key value) that associat...
iterator insert(const_iterator __hint, value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::iterator iterator
Iterator-related typedefs.
void max_load_factor(float __z)
Change the unordered_map maximum load factor.
const mapped_type & at(const key_type &__k) const
Access to unordered_map data.
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
node_type extract(const key_type &__key)
Extract a node.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_map.
auto find(const _Kt &__x) -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_map.
unordered_map & operator=(initializer_list< value_type > __l)
Unordered_map list assignment operator.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
auto find(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_map.
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, iterator > insert(const_iterator __hint, _Pair &&__x)
Attempts to insert a std::pair into the unordered_map.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
mapped_type & at(const key_type &__k)
Access to unordered_map data.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_map.
iterator try_emplace(const_iterator __hint, const 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.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
void reserve(size_type __n)
Prepare the unordered_map for a specified number of elements.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
iterator insert(const_iterator, node_type &&__nh)
Re-insert an extracted node.
_Hashtable::reference reference
Iterator-related typedefs.
iterator insert(const_iterator __hint, const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::allocator_type allocator_type
Public typedefs.
unordered_map(const unordered_map &)=default
Copy constructor.
size_type count(const key_type &__x) const
Finds the number of elements.
bool empty() const noexcept
Returns true if the unordered_map is empty.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_map.
unordered_map(unordered_map &&)=default
Move constructor.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
auto equal_range(const _Kt &__x) -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
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 max_size() const noexcept
Returns the maximum size of the unordered_map.
const_iterator end() const noexcept
unordered_map()=default
Default constructor.
_Hashtable::mapped_type mapped_type
Public typedefs.
unordered_map & operator=(unordered_map &&)=default
Move assignment operator.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
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.
std::pair< iterator, bool > emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
size_type size() const noexcept
Returns the size of 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.
mapped_type & operator[](key_type &&__k)
Subscript ( [] ) access to unordered_map data.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::hasher hasher
Public typedefs.
pair< iterator, bool > insert_or_assign(const key_type &__k, _Obj &&__obj)
Attempts to insert a std::pair into the unordered_map.
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.
mapped_type & operator[](const key_type &__k)
Subscript ( [] ) access to unordered_map data.
pair< iterator, bool > try_emplace(const key_type &__k, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
const_iterator begin() const noexcept
key_equal key_eq() const
Returns the key comparison object with which the unordered_map was constructed.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
_Hashtable::key_equal key_equal
Public typedefs.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
iterator erase(iterator __position)
Erases an element from an unordered_map.
const_iterator cend() const noexcept
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
_Hashtable::pointer pointer
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.
unordered_map(const allocator_type &__a)
Creates an unordered_map with no elements.
_Hashtable::key_type key_type
Public typedefs.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_map.
iterator begin() noexcept
hasher hash_function() const
Returns the hash functor object with which the unordered_map was constructed.
auto equal_range(const _Kt &__x) const -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
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.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
_Hashtable::size_type size_type
Iterator-related typedefs.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_map.
float load_factor() const noexcept
Returns the average number of elements per bucket.
iterator erase(const_iterator __position)
Erases an element from an unordered_map.
void swap(unordered_map &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_map.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
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_map & operator=(const unordered_map &)=default
Copy assignment operator.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
auto count(const _Kt &__x) const -> decltype(_M_h._M_count_tr(__x))
Finds the number of elements.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_map.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
insert_return_type insert(node_type &&__nh)
Re-insert an extracted node.
_Hashtable::value_type value_type
Public typedefs.
void rehash(size_type __n)
May rehash the unordered_map.
const_iterator cbegin() const noexcept