30 #ifndef _UNORDERED_MAP_H
31 #define _UNORDERED_MAP_H
33 namespace std _GLIBCXX_VISIBILITY(default)
35 _GLIBCXX_BEGIN_NAMESPACE_VERSION
36 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
42 template<
typename _Key,
49 _Alloc, __detail::_Select1st,
59 template<
typename _Key,
66 _Alloc, __detail::_Select1st,
72 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
98 template<
typename _Key,
typename _Tp,
114 typedef typename _Hashtable::hasher
hasher;
133 #if __cplusplus > 201402L
134 using node_type =
typename _Hashtable::node_type;
135 using insert_return_type =
typename _Hashtable::insert_return_type;
155 : _M_h(__n, __hf, __eql, __a)
171 template<
typename _InputIterator>
177 : _M_h(__first, __last, __n, __hf, __eql, __a)
202 : _M_h(__umap._M_h, __a)
212 noexcept( noexcept(_Hashtable(
std::move(__umap._M_h), __a)) )
213 : _M_h(
std::
move(__umap._M_h), __a)
232 : _M_h(__l, __n, __hf, __eql, __a)
244 template<
typename _InputIterator>
251 template<
typename _InputIterator>
299 {
return _M_h.get_allocator(); }
304 _GLIBCXX_NODISCARD
bool
306 {
return _M_h.empty(); }
311 {
return _M_h.size(); }
316 {
return _M_h.max_size(); }
326 {
return _M_h.begin(); }
335 {
return _M_h.begin(); }
339 {
return _M_h.begin(); }
348 {
return _M_h.end(); }
357 {
return _M_h.end(); }
361 {
return _M_h.end(); }
386 template<
typename... _Args>
389 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
417 template<
typename... _Args>
420 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
422 #if __cplusplus > 201402L
427 __glibcxx_assert(__pos !=
end());
428 return _M_h.extract(__pos);
434 {
return _M_h.extract(__key); }
439 {
return _M_h._M_reinsert_node(
std::move(__nh)); }
444 {
return _M_h._M_reinsert_node(
std::move(__nh)).position; }
446 #define __cpp_lib_unordered_map_try_emplace 201411
469 template <
typename... _Args>
471 try_emplace(
const key_type& __k, _Args&&... __args)
479 std::forward<_Args>(__args)...))
487 template <
typename... _Args>
489 try_emplace(
key_type&& __k, _Args&&... __args)
497 std::forward<_Args>(__args)...))
532 template <
typename... _Args>
542 std::forward<_Args>(__args)...));
547 template <
typename... _Args>
556 std::forward<_Args>(__args)...));
581 {
return _M_h.insert(__x); }
589 template<
typename _Pair>
590 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
593 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
620 {
return _M_h.insert(__hint, __x); }
626 {
return _M_h.insert(__hint,
std::move(__x)); }
628 template<
typename _Pair>
629 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
631 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
643 template<
typename _InputIterator>
645 insert(_InputIterator __first, _InputIterator __last)
646 { _M_h.insert(__first, __last); }
657 { _M_h.insert(__l); }
660 #if __cplusplus > 201402L
681 template <
typename _Obj>
683 insert_or_assign(
const key_type& __k, _Obj&& __obj)
694 (*__i).second = std::forward<_Obj>(__obj);
699 template <
typename _Obj>
701 insert_or_assign(
key_type&& __k, _Obj&& __obj)
712 (*__i).second = std::forward<_Obj>(__obj);
742 template <
typename _Obj>
753 std::forward<_Obj>(__obj)));
755 (*__i).second = std::forward<_Obj>(__obj);
760 template <
typename _Obj>
770 std::forward<_Obj>(__obj)));
772 (*__i).second = std::forward<_Obj>(__obj);
793 {
return _M_h.erase(__position); }
798 {
return _M_h.erase(__position); }
815 {
return _M_h.erase(__x); }
833 {
return _M_h.erase(__first, __last); }
857 noexcept( noexcept(_M_h.swap(__x._M_h)) )
858 { _M_h.swap(__x._M_h); }
860 #if __cplusplus > 201402L
861 template<
typename,
typename,
typename>
862 friend class std::_Hash_merge_helper;
864 template<
typename _H2,
typename _P2>
868 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
869 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
872 template<
typename _H2,
typename _P2>
874 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
877 template<
typename _H2,
typename _P2>
879 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
881 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
882 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
885 template<
typename _H2,
typename _P2>
887 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
897 {
return _M_h.hash_function(); }
903 {
return _M_h.key_eq(); }
921 {
return _M_h.find(__x); }
925 {
return _M_h.find(__x); }
939 {
return _M_h.count(__x); }
941 #if __cplusplus > 201703L
949 {
return _M_h.find(__x) != _M_h.end(); }
963 {
return _M_h.equal_range(__x); }
967 {
return _M_h.equal_range(__x); }
985 {
return _M_h[__k]; }
1002 {
return _M_h.at(__k); }
1006 {
return _M_h.at(__k); }
1014 {
return _M_h.bucket_count(); }
1019 {
return _M_h.max_bucket_count(); }
1028 {
return _M_h.bucket_size(__n); }
1036 bucket(
const key_type& __key)
const
1037 {
return _M_h.bucket(__key); }
1047 {
return _M_h.begin(__n); }
1058 {
return _M_h.begin(__n); }
1062 {
return _M_h.cbegin(__n); }
1073 {
return _M_h.end(__n); }
1084 {
return _M_h.end(__n); }
1088 {
return _M_h.cend(__n); }
1096 {
return _M_h.load_factor(); }
1102 {
return _M_h.max_load_factor(); }
1110 { _M_h.max_load_factor(__z); }
1121 { _M_h.rehash(__n); }
1132 { _M_h.reserve(__n); }
1134 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1141 #if __cpp_deduction_guides >= 201606
1143 template<
typename _InputIterator,
1144 typename _Hash = hash<__iter_key_t<_InputIterator>>,
1145 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
1146 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
1147 typename = _RequireInputIter<_InputIterator>,
1148 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1149 typename = _RequireNotAllocator<_Pred>,
1150 typename = _RequireAllocator<_Allocator>>
1151 unordered_map(_InputIterator, _InputIterator,
1153 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1154 -> unordered_map<__iter_key_t<_InputIterator>,
1155 __iter_val_t<_InputIterator>,
1156 _Hash, _Pred, _Allocator>;
1158 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1159 typename _Pred = equal_to<_Key>,
1160 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1161 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1162 typename = _RequireNotAllocator<_Pred>,
1163 typename = _RequireAllocator<_Allocator>>
1164 unordered_map(initializer_list<pair<_Key, _Tp>>,
1166 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1167 -> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
1169 template<
typename _InputIterator,
typename _Allocator,
1170 typename = _RequireInputIter<_InputIterator>,
1171 typename = _RequireAllocator<_Allocator>>
1172 unordered_map(_InputIterator, _InputIterator,
1174 -> unordered_map<__iter_key_t<_InputIterator>,
1175 __iter_val_t<_InputIterator>,
1176 hash<__iter_key_t<_InputIterator>>,
1177 equal_to<__iter_key_t<_InputIterator>>,
1180 template<
typename _InputIterator,
typename _Allocator,
1181 typename = _RequireInputIter<_InputIterator>,
1182 typename = _RequireAllocator<_Allocator>>
1183 unordered_map(_InputIterator, _InputIterator, _Allocator)
1184 -> unordered_map<__iter_key_t<_InputIterator>,
1185 __iter_val_t<_InputIterator>,
1186 hash<__iter_key_t<_InputIterator>>,
1187 equal_to<__iter_key_t<_InputIterator>>,
1190 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1191 typename = _RequireInputIter<_InputIterator>,
1192 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1193 typename = _RequireAllocator<_Allocator>>
1194 unordered_map(_InputIterator, _InputIterator,
1197 -> unordered_map<__iter_key_t<_InputIterator>,
1198 __iter_val_t<_InputIterator>, _Hash,
1199 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1201 template<
typename _Key,
typename _Tp,
typename _Allocator,
1202 typename = _RequireAllocator<_Allocator>>
1203 unordered_map(initializer_list<pair<_Key, _Tp>>,
1206 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1208 template<
typename _Key,
typename _Tp,
typename _Allocator,
1209 typename = _RequireAllocator<_Allocator>>
1210 unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
1211 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1213 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1214 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1215 typename = _RequireAllocator<_Allocator>>
1216 unordered_map(initializer_list<pair<_Key, _Tp>>,
1219 -> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
1246 template<
typename _Key,
typename _Tp,
1247 typename _Hash = hash<_Key>,
1248 typename _Pred = equal_to<_Key>,
1249 typename _Alloc = allocator<std::pair<const _Key, _Tp>>>
1281 #if __cplusplus > 201402L
1282 using node_type =
typename _Hashtable::node_type;
1302 : _M_h(__n, __hf, __eql, __a)
1318 template<
typename _InputIterator>
1324 : _M_h(__first, __last, __n, __hf, __eql, __a)
1349 : _M_h(__ummap._M_h, __a)
1359 noexcept( noexcept(_Hashtable(
std::move(__ummap._M_h), __a)) )
1360 : _M_h(
std::
move(__ummap._M_h), __a)
1379 : _M_h(__l, __n, __hf, __eql, __a)
1391 template<
typename _InputIterator>
1398 template<
typename _InputIterator>
1446 {
return _M_h.get_allocator(); }
1451 _GLIBCXX_NODISCARD
bool
1453 {
return _M_h.empty(); }
1458 {
return _M_h.size(); }
1463 {
return _M_h.max_size(); }
1473 {
return _M_h.begin(); }
1482 {
return _M_h.begin(); }
1486 {
return _M_h.begin(); }
1495 {
return _M_h.end(); }
1504 {
return _M_h.end(); }
1508 {
return _M_h.end(); }
1528 template<
typename... _Args>
1531 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1555 template<
typename... _Args>
1558 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1572 {
return _M_h.insert(__x); }
1578 template<
typename _Pair>
1579 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1581 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
1606 {
return _M_h.insert(__hint, __x); }
1612 {
return _M_h.insert(__hint,
std::move(__x)); }
1614 template<
typename _Pair>
1615 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1617 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
1629 template<
typename _InputIterator>
1631 insert(_InputIterator __first, _InputIterator __last)
1632 { _M_h.insert(__first, __last); }
1644 { _M_h.insert(__l); }
1646 #if __cplusplus > 201402L
1651 __glibcxx_assert(__pos !=
end());
1652 return _M_h.extract(__pos);
1658 {
return _M_h.extract(__key); }
1663 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1668 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1687 {
return _M_h.erase(__position); }
1692 {
return _M_h.erase(__position); }
1708 {
return _M_h.erase(__x); }
1727 {
return _M_h.erase(__first, __last); }
1751 noexcept( noexcept(_M_h.swap(__x._M_h)) )
1752 { _M_h.swap(__x._M_h); }
1754 #if __cplusplus > 201402L
1755 template<
typename,
typename,
typename>
1756 friend class std::_Hash_merge_helper;
1758 template<
typename _H2,
typename _P2>
1763 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1764 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1767 template<
typename _H2,
typename _P2>
1769 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1770 { merge(__source); }
1772 template<
typename _H2,
typename _P2>
1774 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
1777 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1778 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1781 template<
typename _H2,
typename _P2>
1783 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1784 { merge(__source); }
1793 {
return _M_h.hash_function(); }
1799 {
return _M_h.key_eq(); }
1817 {
return _M_h.find(__x); }
1821 {
return _M_h.find(__x); }
1831 {
return _M_h.count(__x); }
1833 #if __cplusplus > 201703L
1840 contains(
const key_type& __x)
const
1841 {
return _M_h.find(__x) != _M_h.end(); }
1853 {
return _M_h.equal_range(__x); }
1857 {
return _M_h.equal_range(__x); }
1865 {
return _M_h.bucket_count(); }
1870 {
return _M_h.max_bucket_count(); }
1879 {
return _M_h.bucket_size(__n); }
1887 bucket(
const key_type& __key)
const
1888 {
return _M_h.bucket(__key); }
1898 {
return _M_h.begin(__n); }
1909 {
return _M_h.begin(__n); }
1913 {
return _M_h.cbegin(__n); }
1924 {
return _M_h.end(__n); }
1935 {
return _M_h.end(__n); }
1939 {
return _M_h.cend(__n); }
1947 {
return _M_h.load_factor(); }
1953 {
return _M_h.max_load_factor(); }
1961 { _M_h.max_load_factor(__z); }
1972 { _M_h.rehash(__n); }
1983 { _M_h.reserve(__n); }
1985 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1989 _Hash1, _Pred1, _Alloc1>&,
1991 _Hash1, _Pred1, _Alloc1>&);
1994 #if __cpp_deduction_guides >= 201606
1996 template<
typename _InputIterator,
1997 typename _Hash = hash<__iter_key_t<_InputIterator>>,
1998 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
1999 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
2000 typename = _RequireInputIter<_InputIterator>,
2001 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2002 typename = _RequireNotAllocator<_Pred>,
2003 typename = _RequireAllocator<_Allocator>>
2004 unordered_multimap(_InputIterator, _InputIterator,
2006 _Hash = _Hash(), _Pred = _Pred(),
2007 _Allocator = _Allocator())
2008 -> unordered_multimap<__iter_key_t<_InputIterator>,
2009 __iter_val_t<_InputIterator>, _Hash, _Pred,
2012 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
2013 typename _Pred = equal_to<_Key>,
2014 typename _Allocator = allocator<pair<const _Key, _Tp>>,
2015 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2016 typename = _RequireNotAllocator<_Pred>,
2017 typename = _RequireAllocator<_Allocator>>
2018 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2020 _Hash = _Hash(), _Pred = _Pred(),
2021 _Allocator = _Allocator())
2022 -> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
2024 template<
typename _InputIterator,
typename _Allocator,
2025 typename = _RequireInputIter<_InputIterator>,
2026 typename = _RequireAllocator<_Allocator>>
2027 unordered_multimap(_InputIterator, _InputIterator,
2029 -> unordered_multimap<__iter_key_t<_InputIterator>,
2030 __iter_val_t<_InputIterator>,
2031 hash<__iter_key_t<_InputIterator>>,
2032 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2034 template<
typename _InputIterator,
typename _Allocator,
2035 typename = _RequireInputIter<_InputIterator>,
2036 typename = _RequireAllocator<_Allocator>>
2037 unordered_multimap(_InputIterator, _InputIterator, _Allocator)
2038 -> unordered_multimap<__iter_key_t<_InputIterator>,
2039 __iter_val_t<_InputIterator>,
2040 hash<__iter_key_t<_InputIterator>>,
2041 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2043 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
2044 typename = _RequireInputIter<_InputIterator>,
2045 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2046 typename = _RequireAllocator<_Allocator>>
2047 unordered_multimap(_InputIterator, _InputIterator,
2050 -> unordered_multimap<__iter_key_t<_InputIterator>,
2051 __iter_val_t<_InputIterator>, _Hash,
2052 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2054 template<
typename _Key,
typename _Tp,
typename _Allocator,
2055 typename = _RequireAllocator<_Allocator>>
2056 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2059 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2061 template<
typename _Key,
typename _Tp,
typename _Allocator,
2062 typename = _RequireAllocator<_Allocator>>
2063 unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
2064 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2066 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
2067 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2068 typename = _RequireAllocator<_Allocator>>
2069 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2072 -> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
2076 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2078 swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2079 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2080 noexcept(noexcept(__x.swap(__y)))
2083 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2085 swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2086 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2087 noexcept(noexcept(__x.swap(__y)))
2090 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2092 operator==(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2093 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2094 {
return __x._M_h._M_equal(__y._M_h); }
2096 #if __cpp_impl_three_way_comparison < 201907L
2097 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2099 operator!=(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2100 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2101 {
return !(__x == __y); }
2104 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2106 operator==(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2107 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2108 {
return __x._M_h._M_equal(__y._M_h); }
2110 #if __cpp_impl_three_way_comparison < 201907L
2111 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2113 operator!=(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2114 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2115 {
return !(__x == __y); }
2118 _GLIBCXX_END_NAMESPACE_CONTAINER
2120 #if __cplusplus > 201402L
2122 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2123 typename _Alloc,
typename _Hash2,
typename _Eq2>
2124 struct _Hash_merge_helper<
2125 _GLIBCXX_STD_C::unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2129 template<
typename... _Tp>
2130 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2131 template<
typename... _Tp>
2132 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2134 friend unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2137 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2138 {
return __map._M_h; }
2141 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2142 {
return __map._M_h; }
2146 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2147 typename _Alloc,
typename _Hash2,
typename _Eq2>
2148 struct _Hash_merge_helper<
2149 _GLIBCXX_STD_C::unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2153 template<
typename... _Tp>
2154 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2155 template<
typename... _Tp>
2156 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2158 friend unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2161 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2162 {
return __map._M_h; }
2165 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2166 {
return __map._M_h; }
2170 _GLIBCXX_END_NAMESPACE_VERSION
constexpr piecewise_construct_t piecewise_construct
Tag for piecewise construction of std::pair objects.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr tuple< _Elements &&... > forward_as_tuple(_Elements &&... __args) noexcept
std::forward_as_tuple
ISO C++ entities toplevel namespace is std.
Primary class template hash.
The standard allocator, as per C++03 [20.4.1].
Default range hashing function: use division to fold a large number into the range [0,...
Default ranged hash function H. In principle it should be a function object composed from objects of ...
Default value for rehash policy. Bucket size is (usually) the smallest prime that keeps the load fact...
One of the comparison functors.
Struct holding two objects of arbitrary type.
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.
unordered_multimap & operator=(const unordered_multimap &)=default
Copy assignment operator.
_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.
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.
unordered_multimap & operator=(initializer_list< value_type > __l)
Unordered_multimap list assignment operator.
iterator begin() noexcept
const_iterator begin() const noexcept
hasher hash_function() const
Returns the hash functor object with which the unordered_multimap was constructed.
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.
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(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.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
iterator erase(const_iterator __position)
Erases an element from an unordered_multimap.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
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.
_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.
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.
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.
_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.
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.
unordered_multimap & operator=(unordered_multimap &&)=default
Move assignment operator.
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.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(_Pair &&__x)
Inserts a std::pair into the unordered_multimap.
const_iterator cbegin() const noexcept
_Hashtable::key_type key_type
Public typedefs.
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.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(const_iterator __hint, _Pair &&__x)
Inserts a std::pair into the unordered_multimap.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
iterator insert(const_iterator __hint, value_type &&__x)
Inserts a std::pair into the unordered_multimap.
_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.
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.
std::pair< iterator, bool > insert(const 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.
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.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_map.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_map.
const mapped_type & at(const key_type &__k) const
Access to unordered_map data.
mapped_type & operator[](key_type &&__k)
Subscript ( [] ) access to unordered_map data.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
mapped_type & operator[](const key_type &__k)
Subscript ( [] ) access to unordered_map data.
void reserve(size_type __n)
Prepare the unordered_map for a specified number of elements.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
_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 & operator=(initializer_list< value_type > __l)
Unordered_map list assignment operator.
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.
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.
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.
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.
unordered_map & operator=(unordered_map &&)=default
Move assignment operator.
mapped_type & at(const key_type &__k)
Access to unordered_map data.
_Hashtable::hasher hasher
Public typedefs.
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.
const_iterator begin() const noexcept
std::pair< iterator, bool > emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
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.
__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.
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.
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.
unordered_map & operator=(const unordered_map &)=default
Copy assignment operator.
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.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert a std::pair into the 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.
__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.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
_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.
_Hashtable::value_type value_type
Public typedefs.
void rehash(size_type __n)
May rehash the unordered_map.
const_iterator cbegin() const noexcept