30 #ifndef _UNORDERED_MAP_H
31 #define _UNORDERED_MAP_H
38 namespace 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 // >= C++17 && HOSTED
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)
209 : _M_h(__umap._M_h, __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)
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>
396 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
424 template<
typename... _Args>
427 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
429 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED
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; }
452 #endif // node_extract
454 #ifdef __glibcxx_unordered_map_try_emplace // C++ >= 17 && HOSTED
477 template <
typename... _Args>
481 return _M_h.try_emplace(
cend(), __k, std::forward<_Args>(__args)...);
485 template <
typename... _Args>
490 std::forward<_Args>(__args)...);
521 template <
typename... _Args>
526 return _M_h.try_emplace(__hint, __k,
527 std::forward<_Args>(__args)...).first;
531 template <
typename... _Args>
535 return _M_h.try_emplace(__hint,
std::move(__k),
536 std::forward<_Args>(__args)...).first;
538 #endif // __glibcxx_unordered_map_try_emplace
560 {
return _M_h.insert(__x); }
568 template<
typename _Pair>
569 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
572 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
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>
610 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
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 // >= C++17 && HOSTED
660 template <
typename _Obj>
664 auto __ret = _M_h.try_emplace(
cend(), __k,
665 std::forward<_Obj>(__obj));
667 __ret.first->second = std::forward<_Obj>(__obj);
672 template <
typename _Obj>
677 std::forward<_Obj>(__obj));
679 __ret.first->second = std::forward<_Obj>(__obj);
709 template <
typename _Obj>
714 auto __ret = _M_h.try_emplace(__hint, __k, std::forward<_Obj>(__obj));
716 __ret.first->second = std::forward<_Obj>(__obj);
721 template <
typename _Obj>
725 auto __ret = _M_h.try_emplace(__hint,
std::move(__k),
726 std::forward<_Obj>(__obj));
728 __ret.first->second = std::forward<_Obj>(__obj);
731 #endif // unordered_map_try_emplace
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 // >= C++17 && HOSTED
817 template<
typename,
typename,
typename>
818 friend class std::_Hash_merge_helper;
820 template<
typename _H2,
typename _P2>
824 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
825 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
828 template<
typename _H2,
typename _P2>
830 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
833 template<
typename _H2,
typename _P2>
835 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
837 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
838 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
841 template<
typename _H2,
typename _P2>
843 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
845 #endif // node_extract
853 {
return _M_h.hash_function(); }
859 {
return _M_h.key_eq(); }
877 {
return _M_h.find(__x); }
879 #if __cplusplus > 201703L
880 template<
typename _Kt>
882 find(
const _Kt& __x) -> decltype(_M_h._M_find_tr(__x))
883 {
return _M_h._M_find_tr(__x); }
888 {
return _M_h.find(__x); }
890 #if __cplusplus > 201703L
891 template<
typename _Kt>
893 find(
const _Kt& __x)
const -> decltype(_M_h._M_find_tr(__x))
894 {
return _M_h._M_find_tr(__x); }
910 {
return _M_h.count(__x); }
912 #if __cplusplus > 201703L
913 template<
typename _Kt>
915 count(
const _Kt& __x)
const -> decltype(_M_h._M_count_tr(__x))
916 {
return _M_h._M_count_tr(__x); }
920 #if __cplusplus > 201703L
929 {
return _M_h.find(__x) != _M_h.end(); }
931 template<
typename _Kt>
934 -> decltype(_M_h._M_find_tr(__x),
void(),
true)
935 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
950 {
return _M_h.equal_range(__x); }
952 #if __cplusplus > 201703L
953 template<
typename _Kt>
956 -> decltype(_M_h._M_equal_range_tr(__x))
957 {
return _M_h._M_equal_range_tr(__x); }
962 {
return _M_h.equal_range(__x); }
964 #if __cplusplus > 201703L
965 template<
typename _Kt>
968 -> decltype(_M_h._M_equal_range_tr(__x))
969 {
return _M_h._M_equal_range_tr(__x); }
988 {
return _M_h[__k]; }
1005 {
return _M_h.at(__k); }
1009 {
return _M_h.at(__k); }
1017 {
return _M_h.bucket_count(); }
1022 {
return _M_h.max_bucket_count(); }
1031 {
return _M_h.bucket_size(__n); }
1039 bucket(
const key_type& __key)
const
1040 {
return _M_h.bucket(__key); }
1050 {
return _M_h.begin(__n); }
1061 {
return _M_h.begin(__n); }
1065 {
return _M_h.cbegin(__n); }
1076 {
return _M_h.end(__n); }
1087 {
return _M_h.end(__n); }
1091 {
return _M_h.cend(__n); }
1099 {
return _M_h.load_factor(); }
1105 {
return _M_h.max_load_factor(); }
1113 { _M_h.max_load_factor(__z); }
1124 { _M_h.rehash(__n); }
1135 { _M_h.reserve(__n); }
1137 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1144 #if __cpp_deduction_guides >= 201606
1146 template<
typename _InputIterator,
1147 typename _Hash = hash<__iter_key_t<_InputIterator>>,
1148 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
1149 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
1150 typename = _RequireInputIter<_InputIterator>,
1151 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1152 typename = _RequireNotAllocator<_Pred>,
1153 typename = _RequireAllocator<_Allocator>>
1154 unordered_map(_InputIterator, _InputIterator,
1156 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1157 -> unordered_map<__iter_key_t<_InputIterator>,
1158 __iter_val_t<_InputIterator>,
1159 _Hash, _Pred, _Allocator>;
1161 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1162 typename _Pred = equal_to<_Key>,
1163 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1164 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1165 typename = _RequireNotAllocator<_Pred>,
1166 typename = _RequireAllocator<_Allocator>>
1167 unordered_map(initializer_list<pair<_Key, _Tp>>,
1169 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1170 -> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
1172 template<
typename _InputIterator,
typename _Allocator,
1173 typename = _RequireInputIter<_InputIterator>,
1174 typename = _RequireAllocator<_Allocator>>
1175 unordered_map(_InputIterator, _InputIterator,
1177 -> unordered_map<__iter_key_t<_InputIterator>,
1178 __iter_val_t<_InputIterator>,
1179 hash<__iter_key_t<_InputIterator>>,
1180 equal_to<__iter_key_t<_InputIterator>>,
1183 template<
typename _InputIterator,
typename _Allocator,
1184 typename = _RequireInputIter<_InputIterator>,
1185 typename = _RequireAllocator<_Allocator>>
1186 unordered_map(_InputIterator, _InputIterator, _Allocator)
1187 -> unordered_map<__iter_key_t<_InputIterator>,
1188 __iter_val_t<_InputIterator>,
1189 hash<__iter_key_t<_InputIterator>>,
1190 equal_to<__iter_key_t<_InputIterator>>,
1193 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1194 typename = _RequireInputIter<_InputIterator>,
1195 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1196 typename = _RequireAllocator<_Allocator>>
1197 unordered_map(_InputIterator, _InputIterator,
1200 -> unordered_map<__iter_key_t<_InputIterator>,
1201 __iter_val_t<_InputIterator>, _Hash,
1202 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1204 template<
typename _Key,
typename _Tp,
typename _Allocator,
1205 typename = _RequireAllocator<_Allocator>>
1206 unordered_map(initializer_list<pair<_Key, _Tp>>,
1209 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1211 template<
typename _Key,
typename _Tp,
typename _Allocator,
1212 typename = _RequireAllocator<_Allocator>>
1213 unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
1214 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1216 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1217 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1218 typename = _RequireAllocator<_Allocator>>
1219 unordered_map(initializer_list<pair<_Key, _Tp>>,
1222 -> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
1251 template<
typename _Key,
typename _Tp,
1252 typename _Hash = hash<_Key>,
1253 typename _Pred = equal_to<_Key>,
1254 typename _Alloc = allocator<std::pair<const _Key, _Tp>>>
1255 class unordered_multimap
1257 typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
1286 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED
1287 using node_type =
typename _Hashtable::node_type;
1307 : _M_h(__n, __hf, __eql, __a)
1323 template<
typename _InputIterator>
1329 : _M_h(__first, __last, __n, __hf, __eql, __a)
1354 : _M_h(__ummap._M_h, __a)
1364 noexcept( noexcept(_Hashtable(
std::move(__ummap._M_h), __a)) )
1365 : _M_h(
std::
move(__ummap._M_h), __a)
1384 : _M_h(__l, __n, __hf, __eql, __a)
1396 template<
typename _InputIterator>
1403 template<
typename _InputIterator>
1451 {
return _M_h.get_allocator(); }
1456 _GLIBCXX_NODISCARD
bool
1458 {
return _M_h.empty(); }
1463 {
return _M_h.size(); }
1468 {
return _M_h.max_size(); }
1478 {
return _M_h.begin(); }
1487 {
return _M_h.begin(); }
1491 {
return _M_h.begin(); }
1500 {
return _M_h.end(); }
1509 {
return _M_h.end(); }
1513 {
return _M_h.end(); }
1533 template<
typename... _Args>
1536 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1560 template<
typename... _Args>
1563 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1577 {
return _M_h.insert(__x); }
1583 template<
typename _Pair>
1584 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1586 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
1611 {
return _M_h.insert(__hint, __x); }
1617 {
return _M_h.insert(__hint,
std::move(__x)); }
1619 template<
typename _Pair>
1620 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1622 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
1634 template<
typename _InputIterator>
1636 insert(_InputIterator __first, _InputIterator __last)
1637 { _M_h.insert(__first, __last); }
1649 { _M_h.insert(__l); }
1651 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED
1656 __glibcxx_assert(__pos !=
end());
1657 return _M_h.extract(__pos);
1663 {
return _M_h.extract(__key); }
1668 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1673 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1674 #endif // node_extract
1692 {
return _M_h.erase(__position); }
1697 {
return _M_h.erase(__position); }
1713 {
return _M_h.erase(__x); }
1732 {
return _M_h.erase(__first, __last); }
1756 noexcept( noexcept(_M_h.swap(__x._M_h)) )
1757 { _M_h.swap(__x._M_h); }
1759 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED
1760 template<
typename,
typename,
typename>
1761 friend class std::_Hash_merge_helper;
1763 template<
typename _H2,
typename _P2>
1768 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1769 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1772 template<
typename _H2,
typename _P2>
1774 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1775 { merge(__source); }
1777 template<
typename _H2,
typename _P2>
1779 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
1782 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1783 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1786 template<
typename _H2,
typename _P2>
1788 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1789 { merge(__source); }
1790 #endif // node_extract
1798 {
return _M_h.hash_function(); }
1804 {
return _M_h.key_eq(); }
1822 {
return _M_h.find(__x); }
1824 #if __cplusplus > 201703L
1825 template<
typename _Kt>
1827 find(
const _Kt& __x) -> decltype(_M_h._M_find_tr(__x))
1828 {
return _M_h._M_find_tr(__x); }
1833 {
return _M_h.find(__x); }
1835 #if __cplusplus > 201703L
1836 template<
typename _Kt>
1838 find(
const _Kt& __x)
const -> decltype(_M_h._M_find_tr(__x))
1839 {
return _M_h._M_find_tr(__x); }
1851 {
return _M_h.count(__x); }
1853 #if __cplusplus > 201703L
1854 template<
typename _Kt>
1856 count(
const _Kt& __x)
const -> decltype(_M_h._M_count_tr(__x))
1857 {
return _M_h._M_count_tr(__x); }
1861 #if __cplusplus > 201703L
1870 {
return _M_h.find(__x) != _M_h.end(); }
1872 template<
typename _Kt>
1875 -> decltype(_M_h._M_find_tr(__x),
void(),
true)
1876 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
1889 {
return _M_h.equal_range(__x); }
1891 #if __cplusplus > 201703L
1892 template<
typename _Kt>
1895 -> decltype(_M_h._M_equal_range_tr(__x))
1896 {
return _M_h._M_equal_range_tr(__x); }
1901 {
return _M_h.equal_range(__x); }
1903 #if __cplusplus > 201703L
1904 template<
typename _Kt>
1907 -> decltype(_M_h._M_equal_range_tr(__x))
1908 {
return _M_h._M_equal_range_tr(__x); }
1917 {
return _M_h.bucket_count(); }
1922 {
return _M_h.max_bucket_count(); }
1931 {
return _M_h.bucket_size(__n); }
1939 bucket(
const key_type& __key)
const
1940 {
return _M_h.bucket(__key); }
1950 {
return _M_h.begin(__n); }
1961 {
return _M_h.begin(__n); }
1965 {
return _M_h.cbegin(__n); }
1976 {
return _M_h.end(__n); }
1987 {
return _M_h.end(__n); }
1991 {
return _M_h.cend(__n); }
1999 {
return _M_h.load_factor(); }
2005 {
return _M_h.max_load_factor(); }
2013 { _M_h.max_load_factor(__z); }
2024 { _M_h.rehash(__n); }
2035 { _M_h.reserve(__n); }
2037 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
2041 _Hash1, _Pred1, _Alloc1>&,
2043 _Hash1, _Pred1, _Alloc1>&);
2046 #if __cpp_deduction_guides >= 201606
2048 template<
typename _InputIterator,
2049 typename _Hash = hash<__iter_key_t<_InputIterator>>,
2050 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
2051 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
2052 typename = _RequireInputIter<_InputIterator>,
2053 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2054 typename = _RequireNotAllocator<_Pred>,
2055 typename = _RequireAllocator<_Allocator>>
2056 unordered_multimap(_InputIterator, _InputIterator,
2058 _Hash = _Hash(), _Pred = _Pred(),
2059 _Allocator = _Allocator())
2060 -> unordered_multimap<__iter_key_t<_InputIterator>,
2061 __iter_val_t<_InputIterator>, _Hash, _Pred,
2064 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
2065 typename _Pred = equal_to<_Key>,
2066 typename _Allocator = allocator<pair<const _Key, _Tp>>,
2067 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2068 typename = _RequireNotAllocator<_Pred>,
2069 typename = _RequireAllocator<_Allocator>>
2070 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2072 _Hash = _Hash(), _Pred = _Pred(),
2073 _Allocator = _Allocator())
2074 -> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
2076 template<
typename _InputIterator,
typename _Allocator,
2077 typename = _RequireInputIter<_InputIterator>,
2078 typename = _RequireAllocator<_Allocator>>
2079 unordered_multimap(_InputIterator, _InputIterator,
2081 -> unordered_multimap<__iter_key_t<_InputIterator>,
2082 __iter_val_t<_InputIterator>,
2083 hash<__iter_key_t<_InputIterator>>,
2084 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2086 template<
typename _InputIterator,
typename _Allocator,
2087 typename = _RequireInputIter<_InputIterator>,
2088 typename = _RequireAllocator<_Allocator>>
2089 unordered_multimap(_InputIterator, _InputIterator, _Allocator)
2090 -> unordered_multimap<__iter_key_t<_InputIterator>,
2091 __iter_val_t<_InputIterator>,
2092 hash<__iter_key_t<_InputIterator>>,
2093 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2095 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
2096 typename = _RequireInputIter<_InputIterator>,
2097 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2098 typename = _RequireAllocator<_Allocator>>
2099 unordered_multimap(_InputIterator, _InputIterator,
2102 -> unordered_multimap<__iter_key_t<_InputIterator>,
2103 __iter_val_t<_InputIterator>, _Hash,
2104 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2106 template<
typename _Key,
typename _Tp,
typename _Allocator,
2107 typename = _RequireAllocator<_Allocator>>
2108 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2111 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2113 template<
typename _Key,
typename _Tp,
typename _Allocator,
2114 typename = _RequireAllocator<_Allocator>>
2115 unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
2116 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2118 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
2119 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2120 typename = _RequireAllocator<_Allocator>>
2121 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2124 -> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
2128 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2130 swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2131 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2132 noexcept(noexcept(__x.swap(__y)))
2135 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2137 swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2138 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2139 noexcept(noexcept(__x.swap(__y)))
2142 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2144 operator==(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2145 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2146 {
return __x._M_h._M_equal(__y._M_h); }
2148 #if __cpp_impl_three_way_comparison < 201907L
2149 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2151 operator!=(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2152 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2153 {
return !(__x == __y); }
2156 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2158 operator==(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2159 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2160 {
return __x._M_h._M_equal(__y._M_h); }
2162 #if __cpp_impl_three_way_comparison < 201907L
2163 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2165 operator!=(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2166 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2167 {
return !(__x == __y); }
2170 _GLIBCXX_END_NAMESPACE_CONTAINER
2172 #ifdef __glibcxx_node_extract // >= C++17 && HOSTED
2174 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2175 typename _Alloc,
typename _Hash2,
typename _Eq2>
2176 struct _Hash_merge_helper<
2177 _GLIBCXX_STD_C::unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2181 template<
typename... _Tp>
2182 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2183 template<
typename... _Tp>
2184 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2186 friend unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2189 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2190 {
return __map._M_h; }
2193 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2194 {
return __map._M_h; }
2198 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2199 typename _Alloc,
typename _Hash2,
typename _Eq2>
2200 struct _Hash_merge_helper<
2201 _GLIBCXX_STD_C::unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2205 template<
typename... _Tp>
2206 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2207 template<
typename... _Tp>
2208 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2210 friend unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2213 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2214 {
return __map._M_h; }
2217 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2218 {
return __map._M_h; }
2220 #endif // node_extract
2222 _GLIBCXX_END_NAMESPACE_VERSION