30#ifndef _UNORDERED_MAP_H
31#define _UNORDERED_MAP_H
33namespace std _GLIBCXX_VISIBILITY(default)
35_GLIBCXX_BEGIN_NAMESPACE_VERSION
36_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
42 template<
typename _Key,
49 _Alloc, __detail::_Select1st,
51 __detail::_Mod_range_hashing,
52 __detail::_Default_ranged_hash,
53 __detail::_Prime_rehash_policy,
_Tr>;
59 template<
typename _Key,
66 _Alloc, __detail::_Select1st,
68 __detail::_Mod_range_hashing,
69 __detail::_Default_ranged_hash,
70 __detail::_Prime_rehash_policy,
_Tr>;
72 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
100 template<
typename _Key,
typename _Tp,
116 typedef typename _Hashtable::hasher
hasher;
135#if __cplusplus > 201402L
136 using node_type =
typename _Hashtable::node_type;
137 using insert_return_type =
typename _Hashtable::insert_return_type;
173 template<
typename _InputIterator>
179 : _M_h(__first, __last, __n,
__hf,
__eql, __a)
214 noexcept(
noexcept(_Hashtable(
std::move(__umap._M_h), __a)) )
246 template<
typename _InputIterator>
253 template<
typename _InputIterator>
301 {
return _M_h.get_allocator(); }
306 _GLIBCXX_NODISCARD
bool
308 {
return _M_h.empty(); }
313 {
return _M_h.size(); }
318 {
return _M_h.max_size(); }
328 {
return _M_h.begin(); }
337 {
return _M_h.begin(); }
341 {
return _M_h.begin(); }
350 {
return _M_h.end(); }
359 {
return _M_h.end(); }
363 {
return _M_h.end(); }
388 template<
typename...
_Args>
419 template<
typename...
_Args>
424#if __cplusplus > 201402L
430 return _M_h.extract(
__pos);
436 {
return _M_h.extract(
__key); }
448#define __cpp_lib_unordered_map_try_emplace 201411L
471 template <
typename...
_Args>
479 template <
typename...
_Args>
515 template <
typename... _Args>
525 template <
typename...
_Args>
554 {
return _M_h.insert(__x); }
562 template<
typename _Pair>
593 {
return _M_h.insert(
__hint, __x); }
601 template<
typename _Pair>
616 template<
typename _InputIterator>
619 { _M_h.insert(__first, __last); }
630 { _M_h.insert(
__l); }
633#if __cplusplus > 201402L
654 template <
typename _Obj>
666 template <
typename _Obj>
703 template <
typename _Obj>
715 template <
typename _Obj>
765 {
return _M_h.erase(__x); }
783 {
return _M_h.erase(__first, __last); }
807 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
808 { _M_h.swap(__x._M_h); }
810#if __cplusplus > 201402L
811 template<
typename,
typename,
typename>
812 friend class std::_Hash_merge_helper;
814 template<
typename _H2,
typename _P2>
819 _M_h._M_merge_unique(_Merge_helper::_S_get_table(
__source));
822 template<
typename _H2,
typename _P2>
824 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
827 template<
typename _H2,
typename _P2>
829 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
831 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
832 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
835 template<
typename _H2,
typename _P2>
837 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
847 {
return _M_h.hash_function(); }
853 {
return _M_h.key_eq(); }
871 {
return _M_h.find(__x); }
873#if __cplusplus > 201703L
874 template<
typename _Kt>
876 find(
const _Kt& __x) ->
decltype(_M_h._M_find_tr(__x))
877 {
return _M_h._M_find_tr(__x); }
882 {
return _M_h.find(__x); }
884#if __cplusplus > 201703L
885 template<
typename _Kt>
887 find(
const _Kt& __x)
const ->
decltype(_M_h._M_find_tr(__x))
888 {
return _M_h._M_find_tr(__x); }
904 {
return _M_h.count(__x); }
906#if __cplusplus > 201703L
907 template<
typename _Kt>
909 count(
const _Kt& __x)
const ->
decltype(_M_h._M_count_tr(__x))
910 {
return _M_h._M_count_tr(__x); }
914#if __cplusplus > 201703L
923 {
return _M_h.find(__x) != _M_h.end(); }
925 template<
typename _Kt>
928 ->
decltype(_M_h._M_find_tr(__x),
void(),
true)
929 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
944 {
return _M_h.equal_range(__x); }
946#if __cplusplus > 201703L
947 template<
typename _Kt>
950 ->
decltype(_M_h._M_equal_range_tr(__x))
951 {
return _M_h._M_equal_range_tr(__x); }
956 {
return _M_h.equal_range(__x); }
958#if __cplusplus > 201703L
959 template<
typename _Kt>
962 ->
decltype(_M_h._M_equal_range_tr(__x))
963 {
return _M_h._M_equal_range_tr(__x); }
982 {
return _M_h[
__k]; }
999 {
return _M_h.at(
__k); }
1003 {
return _M_h.at(
__k); }
1011 {
return _M_h.bucket_count(); }
1016 {
return _M_h.max_bucket_count(); }
1025 {
return _M_h.bucket_size(__n); }
1033 bucket(
const key_type& __key)
const
1034 {
return _M_h.bucket(__key); }
1044 {
return _M_h.begin(__n); }
1055 {
return _M_h.begin(__n); }
1059 {
return _M_h.cbegin(__n); }
1070 {
return _M_h.end(__n); }
1081 {
return _M_h.end(__n); }
1085 {
return _M_h.cend(__n); }
1093 {
return _M_h.load_factor(); }
1099 {
return _M_h.max_load_factor(); }
1107 { _M_h.max_load_factor(
__z); }
1118 { _M_h.rehash(__n); }
1129 { _M_h.reserve(__n); }
1138#if __cpp_deduction_guides >= 201606
1140 template<
typename _InputIterator,
1141 typename _Hash = hash<__iter_key_t<_InputIterator>>,
1142 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
1143 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
1144 typename = _RequireInputIter<_InputIterator>,
1145 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1146 typename = _RequireNotAllocator<_Pred>,
1147 typename = _RequireAllocator<_Allocator>>
1148 unordered_map(_InputIterator, _InputIterator,
1150 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1151 -> unordered_map<__iter_key_t<_InputIterator>,
1152 __iter_val_t<_InputIterator>,
1153 _Hash, _Pred, _Allocator>;
1155 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1156 typename _Pred = equal_to<_Key>,
1157 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1158 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1159 typename = _RequireNotAllocator<_Pred>,
1160 typename = _RequireAllocator<_Allocator>>
1161 unordered_map(initializer_list<pair<_Key, _Tp>>,
1163 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1164 -> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
1166 template<
typename _InputIterator,
typename _Allocator,
1167 typename = _RequireInputIter<_InputIterator>,
1168 typename = _RequireAllocator<_Allocator>>
1169 unordered_map(_InputIterator, _InputIterator,
1171 -> unordered_map<__iter_key_t<_InputIterator>,
1172 __iter_val_t<_InputIterator>,
1173 hash<__iter_key_t<_InputIterator>>,
1174 equal_to<__iter_key_t<_InputIterator>>,
1177 template<
typename _InputIterator,
typename _Allocator,
1178 typename = _RequireInputIter<_InputIterator>,
1179 typename = _RequireAllocator<_Allocator>>
1180 unordered_map(_InputIterator, _InputIterator, _Allocator)
1181 -> unordered_map<__iter_key_t<_InputIterator>,
1182 __iter_val_t<_InputIterator>,
1183 hash<__iter_key_t<_InputIterator>>,
1184 equal_to<__iter_key_t<_InputIterator>>,
1187 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1188 typename = _RequireInputIter<_InputIterator>,
1189 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1190 typename = _RequireAllocator<_Allocator>>
1191 unordered_map(_InputIterator, _InputIterator,
1194 -> unordered_map<__iter_key_t<_InputIterator>,
1195 __iter_val_t<_InputIterator>, _Hash,
1196 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1198 template<
typename _Key,
typename _Tp,
typename _Allocator,
1199 typename = _RequireAllocator<_Allocator>>
1200 unordered_map(initializer_list<pair<_Key, _Tp>>,
1203 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1205 template<
typename _Key,
typename _Tp,
typename _Allocator,
1206 typename = _RequireAllocator<_Allocator>>
1207 unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
1208 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1210 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1211 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1212 typename = _RequireAllocator<_Allocator>>
1213 unordered_map(initializer_list<pair<_Key, _Tp>>,
1216 -> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
1245 template<
typename _Key,
typename _Tp,
1246 typename _Hash = hash<_Key>,
1247 typename _Pred = equal_to<_Key>,
1248 typename _Alloc = allocator<std::pair<const _Key, _Tp>>>
1280#if __cplusplus > 201402L
1281 using node_type =
typename _Hashtable::node_type;
1317 template<
typename _InputIterator>
1323 : _M_h(__first, __last, __n,
__hf,
__eql, __a)
1358 noexcept(
noexcept(_Hashtable(
std::move(__ummap._M_h), __a)) )
1390 template<
typename _InputIterator>
1397 template<
typename _InputIterator>
1445 {
return _M_h.get_allocator(); }
1450 _GLIBCXX_NODISCARD
bool
1452 {
return _M_h.empty(); }
1457 {
return _M_h.size(); }
1462 {
return _M_h.max_size(); }
1472 {
return _M_h.begin(); }
1481 {
return _M_h.begin(); }
1485 {
return _M_h.begin(); }
1494 {
return _M_h.end(); }
1503 {
return _M_h.end(); }
1507 {
return _M_h.end(); }
1527 template<
typename...
_Args>
1554 template<
typename...
_Args>
1571 {
return _M_h.insert(__x); }
1577 template<
typename _Pair>
1605 {
return _M_h.insert(
__hint, __x); }
1613 template<
typename _Pair>
1628 template<
typename _InputIterator>
1631 { _M_h.insert(__first, __last); }
1643 { _M_h.insert(
__l); }
1645#if __cplusplus > 201402L
1651 return _M_h.extract(
__pos);
1657 {
return _M_h.extract(
__key); }
1707 {
return _M_h.erase(__x); }
1726 {
return _M_h.erase(__first, __last); }
1750 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
1751 { _M_h.swap(__x._M_h); }
1753#if __cplusplus > 201402L
1754 template<
typename,
typename,
typename>
1755 friend class std::_Hash_merge_helper;
1757 template<
typename _H2,
typename _P2>
1763 _M_h._M_merge_multi(_Merge_helper::_S_get_table(
__source));
1766 template<
typename _H2,
typename _P2>
1768 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1769 { merge(__source); }
1771 template<
typename _H2,
typename _P2>
1773 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
1776 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1777 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1780 template<
typename _H2,
typename _P2>
1782 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1783 { merge(__source); }
1792 {
return _M_h.hash_function(); }
1798 {
return _M_h.key_eq(); }
1816 {
return _M_h.find(__x); }
1818#if __cplusplus > 201703L
1819 template<
typename _Kt>
1821 find(
const _Kt& __x) ->
decltype(_M_h._M_find_tr(__x))
1822 {
return _M_h._M_find_tr(__x); }
1827 {
return _M_h.find(__x); }
1829#if __cplusplus > 201703L
1830 template<
typename _Kt>
1832 find(
const _Kt& __x)
const ->
decltype(_M_h._M_find_tr(__x))
1833 {
return _M_h._M_find_tr(__x); }
1845 {
return _M_h.count(__x); }
1847#if __cplusplus > 201703L
1848 template<
typename _Kt>
1850 count(
const _Kt& __x)
const ->
decltype(_M_h._M_count_tr(__x))
1851 {
return _M_h._M_count_tr(__x); }
1855#if __cplusplus > 201703L
1864 {
return _M_h.find(__x) != _M_h.end(); }
1866 template<
typename _Kt>
1869 ->
decltype(_M_h._M_find_tr(__x),
void(),
true)
1870 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
1883 {
return _M_h.equal_range(__x); }
1885#if __cplusplus > 201703L
1886 template<
typename _Kt>
1889 ->
decltype(_M_h._M_equal_range_tr(__x))
1890 {
return _M_h._M_equal_range_tr(__x); }
1895 {
return _M_h.equal_range(__x); }
1897#if __cplusplus > 201703L
1898 template<
typename _Kt>
1901 ->
decltype(_M_h._M_equal_range_tr(__x))
1902 {
return _M_h._M_equal_range_tr(__x); }
1911 {
return _M_h.bucket_count(); }
1916 {
return _M_h.max_bucket_count(); }
1925 {
return _M_h.bucket_size(__n); }
1933 bucket(
const key_type& __key)
const
1934 {
return _M_h.bucket(__key); }
1944 {
return _M_h.begin(__n); }
1955 {
return _M_h.begin(__n); }
1959 {
return _M_h.cbegin(__n); }
1970 {
return _M_h.end(__n); }
1981 {
return _M_h.end(__n); }
1985 {
return _M_h.cend(__n); }
1993 {
return _M_h.load_factor(); }
1999 {
return _M_h.max_load_factor(); }
2007 { _M_h.max_load_factor(
__z); }
2018 { _M_h.rehash(__n); }
2029 { _M_h.reserve(__n); }
2040#if __cpp_deduction_guides >= 201606
2042 template<
typename _InputIterator,
2043 typename _Hash = hash<__iter_key_t<_InputIterator>>,
2044 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
2045 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
2046 typename = _RequireInputIter<_InputIterator>,
2047 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2048 typename = _RequireNotAllocator<_Pred>,
2049 typename = _RequireAllocator<_Allocator>>
2050 unordered_multimap(_InputIterator, _InputIterator,
2052 _Hash = _Hash(), _Pred = _Pred(),
2053 _Allocator = _Allocator())
2054 -> unordered_multimap<__iter_key_t<_InputIterator>,
2055 __iter_val_t<_InputIterator>, _Hash, _Pred,
2058 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
2059 typename _Pred = equal_to<_Key>,
2060 typename _Allocator = allocator<pair<const _Key, _Tp>>,
2061 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2062 typename = _RequireNotAllocator<_Pred>,
2063 typename = _RequireAllocator<_Allocator>>
2064 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2066 _Hash = _Hash(), _Pred = _Pred(),
2067 _Allocator = _Allocator())
2068 -> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
2070 template<
typename _InputIterator,
typename _Allocator,
2071 typename = _RequireInputIter<_InputIterator>,
2072 typename = _RequireAllocator<_Allocator>>
2073 unordered_multimap(_InputIterator, _InputIterator,
2075 -> unordered_multimap<__iter_key_t<_InputIterator>,
2076 __iter_val_t<_InputIterator>,
2077 hash<__iter_key_t<_InputIterator>>,
2078 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2080 template<
typename _InputIterator,
typename _Allocator,
2081 typename = _RequireInputIter<_InputIterator>,
2082 typename = _RequireAllocator<_Allocator>>
2083 unordered_multimap(_InputIterator, _InputIterator, _Allocator)
2084 -> unordered_multimap<__iter_key_t<_InputIterator>,
2085 __iter_val_t<_InputIterator>,
2086 hash<__iter_key_t<_InputIterator>>,
2087 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2089 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
2090 typename = _RequireInputIter<_InputIterator>,
2091 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2092 typename = _RequireAllocator<_Allocator>>
2093 unordered_multimap(_InputIterator, _InputIterator,
2096 -> unordered_multimap<__iter_key_t<_InputIterator>,
2097 __iter_val_t<_InputIterator>, _Hash,
2098 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2100 template<
typename _Key,
typename _Tp,
typename _Allocator,
2101 typename = _RequireAllocator<_Allocator>>
2102 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2105 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2107 template<
typename _Key,
typename _Tp,
typename _Allocator,
2108 typename = _RequireAllocator<_Allocator>>
2109 unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
2110 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2112 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
2113 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2114 typename = _RequireAllocator<_Allocator>>
2115 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2118 -> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
2122 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2124 swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2125 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2126 noexcept(
noexcept(__x.swap(__y)))
2129 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2131 swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2132 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2133 noexcept(
noexcept(__x.swap(__y)))
2136 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2138 operator==(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2139 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2140 {
return __x._M_h._M_equal(__y._M_h); }
2142#if __cpp_impl_three_way_comparison < 201907L
2143 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2145 operator!=(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2146 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2147 {
return !(__x == __y); }
2150 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2152 operator==(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2153 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2154 {
return __x._M_h._M_equal(__y._M_h); }
2156#if __cpp_impl_three_way_comparison < 201907L
2157 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2159 operator!=(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2160 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2161 {
return !(__x == __y); }
2164_GLIBCXX_END_NAMESPACE_CONTAINER
2166#if __cplusplus > 201402L
2168 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2169 typename _Alloc,
typename _Hash2,
typename _Eq2>
2170 struct _Hash_merge_helper<
2171 _GLIBCXX_STD_C::unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2175 template<
typename... _Tp>
2176 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2177 template<
typename... _Tp>
2178 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2180 friend unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2183 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2184 {
return __map._M_h; }
2187 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2188 {
return __map._M_h; }
2192 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2193 typename _Alloc,
typename _Hash2,
typename _Eq2>
2194 struct _Hash_merge_helper<
2195 _GLIBCXX_STD_C::unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2199 template<
typename... _Tp>
2200 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2201 template<
typename... _Tp>
2202 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2204 friend unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2207 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2208 {
return __map._M_h; }
2211 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2212 {
return __map._M_h; }
2216_GLIBCXX_END_NAMESPACE_VERSION
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
void swap(any &__x, any &__y) noexcept
Exchange the states of two any objects.
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.
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