30#ifndef _UNORDERED_MAP_H
31#define _UNORDERED_MAP_H
38namespace std _GLIBCXX_VISIBILITY(default)
40_GLIBCXX_BEGIN_NAMESPACE_VERSION
41_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
47 template<
typename _Key,
53 using __umap_hashtable = _Hashtable<_Key, std::pair<const _Key, _Tp>,
54 _Alloc, __detail::_Select1st,
56 __detail::_Mod_range_hashing,
57 __detail::_Default_ranged_hash,
58 __detail::_Prime_rehash_policy, _Tr>;
64 template<
typename _Key,
70 using __ummap_hashtable = _Hashtable<_Key, std::pair<const _Key, _Tp>,
71 _Alloc, __detail::_Select1st,
73 __detail::_Mod_range_hashing,
74 __detail::_Default_ranged_hash,
75 __detail::_Prime_rehash_policy, _Tr>;
77 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
105 template<
typename _Key,
typename _Tp,
111 typedef __umap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
121 typedef typename _Hashtable::hasher
hasher;
140#ifdef __glibcxx_node_extract
141 using node_type =
typename _Hashtable::node_type;
142 using insert_return_type =
typename _Hashtable::insert_return_type;
162 : _M_h(__n, __hf, __eql, __a)
178 template<
typename _InputIterator>
184 : _M_h(__first, __last, __n, __hf, __eql, __a)
208 const allocator_type& __a)
209 : _M_h(__umap._M_h, __a)
218 const allocator_type& __a)
219 noexcept(
noexcept(_Hashtable(
std::move(__umap._M_h), __a)) )
220 : _M_h(
std::
move(__umap._M_h), __a)
239 : _M_h(__l, __n, __hf, __eql, __a)
247 const allocator_type& __a)
248 : unordered_map(__n, __hf,
key_equal(), __a)
251 template<
typename _InputIterator>
258 template<
typename _InputIterator>
306 {
return _M_h.get_allocator(); }
311 _GLIBCXX_NODISCARD
bool
313 {
return _M_h.empty(); }
318 {
return _M_h.size(); }
323 {
return _M_h.max_size(); }
333 {
return _M_h.begin(); }
342 {
return _M_h.begin(); }
346 {
return _M_h.begin(); }
355 {
return _M_h.end(); }
364 {
return _M_h.end(); }
368 {
return _M_h.end(); }
393 template<
typename... _Args>
424 template<
typename... _Args>
429#ifdef __glibcxx_node_extract
432 extract(const_iterator __pos)
434 __glibcxx_assert(__pos !=
end());
435 return _M_h.extract(__pos);
441 {
return _M_h.extract(__key); }
446 {
return _M_h._M_reinsert_node(
std::move(__nh)); }
451 {
return _M_h._M_reinsert_node(
std::move(__nh)).position; }
454#ifdef __glibcxx_unordered_map_try_emplace
477 template <
typename... _Args>
479 try_emplace(
const key_type& __k, _Args&&... __args)
485 template <
typename... _Args>
487 try_emplace(
key_type&& __k, _Args&&... __args)
521 template <
typename... _Args>
526 return _M_h.try_emplace(__hint, __k,
531 template <
typename... _Args>
535 return _M_h.try_emplace(__hint,
std::move(__k),
560 {
return _M_h.insert(__x); }
568 template<
typename _Pair>
569 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
599 {
return _M_h.insert(__hint, __x); }
605 {
return _M_h.insert(__hint,
std::move(__x)); }
607 template<
typename _Pair>
608 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
622 template<
typename _InputIterator>
624 insert(_InputIterator __first, _InputIterator __last)
625 { _M_h.insert(__first, __last); }
636 { _M_h.insert(__l); }
639#ifdef __glibcxx_unordered_map_try_emplace
660 template <
typename _Obj>
662 insert_or_assign(
const key_type& __k, _Obj&& __obj)
664 auto __ret = _M_h.try_emplace(
cend(), __k,
672 template <
typename _Obj>
674 insert_or_assign(
key_type&& __k, _Obj&& __obj)
709 template <
typename _Obj>
721 template <
typename _Obj>
725 auto __ret = _M_h.try_emplace(__hint,
std::move(__k),
749 {
return _M_h.erase(__position); }
754 {
return _M_h.erase(__position); }
771 {
return _M_h.erase(__x); }
789 {
return _M_h.erase(__first, __last); }
813 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
814 { _M_h.swap(__x._M_h); }
816#ifdef __glibcxx_node_extract
817 template<
typename,
typename,
typename>
818 friend class std::_Hash_merge_helper;
820 template<
typename _H2,
typename _P2>
824 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
828 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
829 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
832 template<
typename _H2,
typename _P2>
834 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
836 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
837 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
840 template<
typename _H2,
typename _P2>
842 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
844 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
845 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
848 template<
typename _H2,
typename _P2>
850 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
860 {
return _M_h.hash_function(); }
866 {
return _M_h.key_eq(); }
884 {
return _M_h.find(__x); }
886#if __cplusplus > 201703L
887 template<
typename _Kt>
889 find(
const _Kt& __x) ->
decltype(_M_h._M_find_tr(__x))
890 {
return _M_h._M_find_tr(__x); }
895 {
return _M_h.find(__x); }
897#if __cplusplus > 201703L
898 template<
typename _Kt>
900 find(
const _Kt& __x)
const ->
decltype(_M_h._M_find_tr(__x))
901 {
return _M_h._M_find_tr(__x); }
917 {
return _M_h.count(__x); }
919#if __cplusplus > 201703L
920 template<
typename _Kt>
922 count(
const _Kt& __x)
const ->
decltype(_M_h._M_count_tr(__x))
923 {
return _M_h._M_count_tr(__x); }
927#if __cplusplus > 201703L
936 {
return _M_h.find(__x) != _M_h.end(); }
938 template<
typename _Kt>
941 ->
decltype(_M_h._M_find_tr(__x),
void(),
true)
942 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
957 {
return _M_h.equal_range(__x); }
959#if __cplusplus > 201703L
960 template<
typename _Kt>
963 ->
decltype(_M_h._M_equal_range_tr(__x))
964 {
return _M_h._M_equal_range_tr(__x); }
969 {
return _M_h.equal_range(__x); }
971#if __cplusplus > 201703L
972 template<
typename _Kt>
975 ->
decltype(_M_h._M_equal_range_tr(__x))
976 {
return _M_h._M_equal_range_tr(__x); }
995 {
return _M_h[__k]; }
1012 {
return _M_h.at(__k); }
1016 {
return _M_h.at(__k); }
1024 {
return _M_h.bucket_count(); }
1029 {
return _M_h.max_bucket_count(); }
1038 {
return _M_h.bucket_size(__n); }
1046 bucket(
const key_type& __key)
const
1047 {
return _M_h.bucket(__key); }
1057 {
return _M_h.begin(__n); }
1068 {
return _M_h.begin(__n); }
1072 {
return _M_h.cbegin(__n); }
1083 {
return _M_h.end(__n); }
1094 {
return _M_h.end(__n); }
1098 {
return _M_h.cend(__n); }
1106 {
return _M_h.load_factor(); }
1112 {
return _M_h.max_load_factor(); }
1120 { _M_h.max_load_factor(__z); }
1131 { _M_h.rehash(__n); }
1142 { _M_h.reserve(__n); }
1144 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1151#if __cpp_deduction_guides >= 201606
1153 template<
typename _InputIterator,
1154 typename _Hash = hash<__iter_key_t<_InputIterator>>,
1155 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
1156 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
1157 typename = _RequireInputIter<_InputIterator>,
1158 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1159 typename = _RequireNotAllocator<_Pred>,
1160 typename = _RequireAllocator<_Allocator>>
1161 unordered_map(_InputIterator, _InputIterator,
1162 typename unordered_map<int, int>::size_type = {},
1163 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1165 __iter_val_t<_InputIterator>,
1166 _Hash, _Pred, _Allocator>;
1168 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1169 typename _Pred = equal_to<_Key>,
1170 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1171 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1172 typename = _RequireNotAllocator<_Pred>,
1173 typename = _RequireAllocator<_Allocator>>
1176 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1179 template<
typename _InputIterator,
typename _Allocator,
1180 typename = _RequireInputIter<_InputIterator>,
1181 typename = _RequireAllocator<_Allocator>>
1185 __iter_val_t<_InputIterator>,
1190 template<
typename _InputIterator,
typename _Allocator,
1191 typename = _RequireInputIter<_InputIterator>,
1192 typename = _RequireAllocator<_Allocator>>
1195 __iter_val_t<_InputIterator>,
1200 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1201 typename = _RequireInputIter<_InputIterator>,
1202 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1203 typename = _RequireAllocator<_Allocator>>
1208 __iter_val_t<_InputIterator>, _Hash,
1211 template<
typename _Key,
typename _Tp,
typename _Allocator,
1212 typename = _RequireAllocator<_Allocator>>
1218 template<
typename _Key,
typename _Tp,
typename _Allocator,
1219 typename = _RequireAllocator<_Allocator>>
1223 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1224 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1225 typename = _RequireAllocator<_Allocator>>
1258 template<
typename _Key,
typename _Tp,
1264 typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
1293#ifdef __glibcxx_node_extract
1294 using node_type =
typename _Hashtable::node_type;
1314 : _M_h(__n, __hf, __eql, __a)
1330 template<
typename _InputIterator>
1336 : _M_h(__first, __last, __n, __hf, __eql, __a)
1360 const allocator_type& __a)
1361 : _M_h(__ummap._M_h, __a)
1370 const allocator_type& __a)
1371 noexcept(
noexcept(_Hashtable(
std::move(__ummap._M_h), __a)) )
1372 : _M_h(
std::
move(__ummap._M_h), __a)
1391 : _M_h(__l, __n, __hf, __eql, __a)
1399 const allocator_type& __a)
1400 : unordered_multimap(__n, __hf,
key_equal(), __a)
1403 template<
typename _InputIterator>
1410 template<
typename _InputIterator>
1458 {
return _M_h.get_allocator(); }
1463 _GLIBCXX_NODISCARD
bool
1465 {
return _M_h.empty(); }
1470 {
return _M_h.size(); }
1475 {
return _M_h.max_size(); }
1485 {
return _M_h.begin(); }
1494 {
return _M_h.begin(); }
1498 {
return _M_h.begin(); }
1507 {
return _M_h.end(); }
1516 {
return _M_h.end(); }
1520 {
return _M_h.end(); }
1540 template<
typename... _Args>
1567 template<
typename... _Args>
1584 {
return _M_h.insert(__x); }
1590 template<
typename _Pair>
1591 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1618 {
return _M_h.insert(__hint, __x); }
1624 {
return _M_h.insert(__hint,
std::move(__x)); }
1626 template<
typename _Pair>
1627 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1641 template<
typename _InputIterator>
1643 insert(_InputIterator __first, _InputIterator __last)
1644 { _M_h.insert(__first, __last); }
1656 { _M_h.insert(__l); }
1658#ifdef __glibcxx_node_extract
1661 extract(const_iterator __pos)
1663 __glibcxx_assert(__pos !=
end());
1664 return _M_h.extract(__pos);
1670 {
return _M_h.extract(__key); }
1675 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1680 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1699 {
return _M_h.erase(__position); }
1704 {
return _M_h.erase(__position); }
1720 {
return _M_h.erase(__x); }
1739 {
return _M_h.erase(__first, __last); }
1763 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
1764 { _M_h.swap(__x._M_h); }
1766#ifdef __glibcxx_node_extract
1767 template<
typename,
typename,
typename>
1768 friend class std::_Hash_merge_helper;
1770 template<
typename _H2,
typename _P2>
1774 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
1779 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1780 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1783 template<
typename _H2,
typename _P2>
1785 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1788 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1789 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1792 template<
typename _H2,
typename _P2>
1794 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
1797 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1798 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1801 template<
typename _H2,
typename _P2>
1803 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1804 { merge(__source); }
1813 {
return _M_h.hash_function(); }
1819 {
return _M_h.key_eq(); }
1837 {
return _M_h.find(__x); }
1839#if __cplusplus > 201703L
1840 template<
typename _Kt>
1842 find(
const _Kt& __x) ->
decltype(_M_h._M_find_tr(__x))
1843 {
return _M_h._M_find_tr(__x); }
1848 {
return _M_h.find(__x); }
1850#if __cplusplus > 201703L
1851 template<
typename _Kt>
1853 find(
const _Kt& __x)
const ->
decltype(_M_h._M_find_tr(__x))
1854 {
return _M_h._M_find_tr(__x); }
1866 {
return _M_h.count(__x); }
1868#if __cplusplus > 201703L
1869 template<
typename _Kt>
1871 count(
const _Kt& __x)
const ->
decltype(_M_h._M_count_tr(__x))
1872 {
return _M_h._M_count_tr(__x); }
1876#if __cplusplus > 201703L
1885 {
return _M_h.find(__x) != _M_h.end(); }
1887 template<
typename _Kt>
1890 ->
decltype(_M_h._M_find_tr(__x),
void(),
true)
1891 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
1904 {
return _M_h.equal_range(__x); }
1906#if __cplusplus > 201703L
1907 template<
typename _Kt>
1910 ->
decltype(_M_h._M_equal_range_tr(__x))
1911 {
return _M_h._M_equal_range_tr(__x); }
1916 {
return _M_h.equal_range(__x); }
1918#if __cplusplus > 201703L
1919 template<
typename _Kt>
1922 ->
decltype(_M_h._M_equal_range_tr(__x))
1923 {
return _M_h._M_equal_range_tr(__x); }
1932 {
return _M_h.bucket_count(); }
1937 {
return _M_h.max_bucket_count(); }
1946 {
return _M_h.bucket_size(__n); }
1954 bucket(
const key_type& __key)
const
1955 {
return _M_h.bucket(__key); }
1965 {
return _M_h.begin(__n); }
1976 {
return _M_h.begin(__n); }
1980 {
return _M_h.cbegin(__n); }
1991 {
return _M_h.end(__n); }
2002 {
return _M_h.end(__n); }
2006 {
return _M_h.cend(__n); }
2014 {
return _M_h.load_factor(); }
2020 {
return _M_h.max_load_factor(); }
2028 { _M_h.max_load_factor(__z); }
2039 { _M_h.rehash(__n); }
2050 { _M_h.reserve(__n); }
2052 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
2056 _Hash1, _Pred1, _Alloc1>&,
2058 _Hash1, _Pred1, _Alloc1>&);
2061#if __cpp_deduction_guides >= 201606
2063 template<
typename _InputIterator,
2064 typename _Hash = hash<__iter_key_t<_InputIterator>>,
2065 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
2066 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
2067 typename = _RequireInputIter<_InputIterator>,
2068 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2069 typename = _RequireNotAllocator<_Pred>,
2070 typename = _RequireAllocator<_Allocator>>
2071 unordered_multimap(_InputIterator, _InputIterator,
2072 unordered_multimap<int, int>::size_type = {},
2073 _Hash = _Hash(), _Pred = _Pred(),
2074 _Allocator = _Allocator())
2076 __iter_val_t<_InputIterator>, _Hash, _Pred,
2079 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
2080 typename _Pred = equal_to<_Key>,
2081 typename _Allocator = allocator<pair<const _Key, _Tp>>,
2082 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2083 typename = _RequireNotAllocator<_Pred>,
2084 typename = _RequireAllocator<_Allocator>>
2087 _Hash = _Hash(), _Pred = _Pred(),
2088 _Allocator = _Allocator())
2091 template<
typename _InputIterator,
typename _Allocator,
2092 typename = _RequireInputIter<_InputIterator>,
2093 typename = _RequireAllocator<_Allocator>>
2097 __iter_val_t<_InputIterator>,
2101 template<
typename _InputIterator,
typename _Allocator,
2102 typename = _RequireInputIter<_InputIterator>,
2103 typename = _RequireAllocator<_Allocator>>
2106 __iter_val_t<_InputIterator>,
2110 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
2111 typename = _RequireInputIter<_InputIterator>,
2112 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2113 typename = _RequireAllocator<_Allocator>>
2118 __iter_val_t<_InputIterator>, _Hash,
2121 template<
typename _Key,
typename _Tp,
typename _Allocator,
2122 typename = _RequireAllocator<_Allocator>>
2128 template<
typename _Key,
typename _Tp,
typename _Allocator,
2129 typename = _RequireAllocator<_Allocator>>
2133 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
2134 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2135 typename = _RequireAllocator<_Allocator>>
2143 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2147 noexcept(
noexcept(__x.swap(__y)))
2150 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2154 noexcept(
noexcept(__x.swap(__y)))
2157 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2161 {
return __x._M_h._M_equal(__y._M_h); }
2163#if __cpp_impl_three_way_comparison < 201907L
2164 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2168 {
return !(__x == __y); }
2171 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2175 {
return __x._M_h._M_equal(__y._M_h); }
2177#if __cpp_impl_three_way_comparison < 201907L
2178 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2182 {
return !(__x == __y); }
2185_GLIBCXX_END_NAMESPACE_CONTAINER
2187#ifdef __glibcxx_node_extract
2189 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2190 typename _Alloc,
typename _Hash2,
typename _Eq2>
2191 struct _Hash_merge_helper<
2192 _GLIBCXX_STD_C::
unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2196 template<
typename... _Tp>
2197 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2198 template<
typename... _Tp>
2199 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2201 friend unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2204 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2205 {
return __map._M_h; }
2208 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2209 {
return __map._M_h; }
2213 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2214 typename _Alloc,
typename _Hash2,
typename _Eq2>
2215 struct _Hash_merge_helper<
2220 template<
typename... _Tp>
2221 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2222 template<
typename... _Tp>
2223 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2225 friend unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2228 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2229 {
return __map._M_h; }
2232 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2233 {
return __map._M_h; }
2237_GLIBCXX_END_NAMESPACE_VERSION
pair(_T1, _T2) -> pair< _T1, _T2 >
Two pairs are equal iff their members are equal.
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.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
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 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
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.
__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
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
iterator emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
_Hashtable::const_reference const_reference
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
_Hashtable::local_iterator local_iterator
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
_Hashtable::allocator_type allocator_type
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
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
_Hashtable::size_type size_type
_Hashtable::const_pointer const_pointer
__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
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
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
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
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.
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
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.
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.
_Hashtable::reference reference
iterator insert(const_iterator __hint, const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::allocator_type allocator_type
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
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
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.
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
_Hashtable::key_equal key_equal
_Hashtable::local_iterator local_iterator
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
unordered_map(const allocator_type &__a)
Creates an unordered_map with no elements.
_Hashtable::key_type key_type
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
_Hashtable::size_type size_type
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
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
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.
_Hashtable::value_type value_type
void rehash(size_type __n)
May rehash the unordered_map.
const_iterator cbegin() const noexcept