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,
48 using __umap_hashtable = _Hashtable<_Key, std::pair<const _Key, _Tp>,
49 _Alloc, __detail::_Select1st,
51 __detail::_Mod_range_hashing,
52 __detail::_Default_ranged_hash,
53 __detail::_Prime_rehash_policy, _Tr>;
59 template<
typename _Key,
65 using __ummap_hashtable = _Hashtable<_Key, std::pair<const _Key, _Tp>,
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,
106 typedef __umap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
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;
157 : _M_h(__n, __hf, __eql, __a)
173 template<
typename _InputIterator>
179 : _M_h(__first, __last, __n, __hf, __eql, __a)
204 : _M_h(__umap._M_h, __a)
214 noexcept( noexcept(_Hashtable(
std::move(__umap._M_h), __a)) )
215 : _M_h(
std::
move(__umap._M_h), __a)
234 : _M_h(__l, __n, __hf, __eql, __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>
391 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
419 template<
typename... _Args>
422 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
424 #if __cplusplus > 201402L
429 __glibcxx_assert(__pos !=
end());
430 return _M_h.extract(__pos);
436 {
return _M_h.extract(__key); }
441 {
return _M_h._M_reinsert_node(
std::move(__nh)); }
446 {
return _M_h._M_reinsert_node(
std::move(__nh)).position; }
448 #define __cpp_lib_unordered_map_try_emplace 201411L
471 template <
typename... _Args>
475 return _M_h.try_emplace(
cend(), __k, std::forward<_Args>(__args)...);
479 template <
typename... _Args>
484 std::forward<_Args>(__args)...);
515 template <
typename... _Args>
520 return _M_h.try_emplace(__hint, __k,
521 std::forward<_Args>(__args)...).first;
525 template <
typename... _Args>
529 return _M_h.try_emplace(__hint,
std::move(__k),
530 std::forward<_Args>(__args)...).first;
554 {
return _M_h.insert(__x); }
562 template<
typename _Pair>
563 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
566 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
593 {
return _M_h.insert(__hint, __x); }
599 {
return _M_h.insert(__hint,
std::move(__x)); }
601 template<
typename _Pair>
602 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
604 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
616 template<
typename _InputIterator>
618 insert(_InputIterator __first, _InputIterator __last)
619 { _M_h.insert(__first, __last); }
630 { _M_h.insert(__l); }
633 #if __cplusplus > 201402L
654 template <
typename _Obj>
658 auto __ret = _M_h.try_emplace(
cend(), __k,
659 std::forward<_Obj>(__obj));
661 __ret.first->second = std::forward<_Obj>(__obj);
666 template <
typename _Obj>
671 std::forward<_Obj>(__obj));
673 __ret.first->second = std::forward<_Obj>(__obj);
703 template <
typename _Obj>
708 auto __ret = _M_h.try_emplace(__hint, __k, std::forward<_Obj>(__obj));
710 __ret.first->second = std::forward<_Obj>(__obj);
715 template <
typename _Obj>
719 auto __ret = _M_h.try_emplace(__hint,
std::move(__k),
720 std::forward<_Obj>(__obj));
722 __ret.first->second = std::forward<_Obj>(__obj);
743 {
return _M_h.erase(__position); }
748 {
return _M_h.erase(__position); }
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>
818 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _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); }
1131 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
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>>>
1249 class unordered_multimap
1251 typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
1280 #if __cplusplus > 201402L
1281 using node_type =
typename _Hashtable::node_type;
1301 : _M_h(__n, __hf, __eql, __a)
1317 template<
typename _InputIterator>
1323 : _M_h(__first, __last, __n, __hf, __eql, __a)
1348 : _M_h(__ummap._M_h, __a)
1358 noexcept( noexcept(_Hashtable(
std::move(__ummap._M_h), __a)) )
1359 : _M_h(
std::
move(__ummap._M_h), __a)
1378 : _M_h(__l, __n, __hf, __eql, __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>
1530 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1554 template<
typename... _Args>
1557 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1571 {
return _M_h.insert(__x); }
1577 template<
typename _Pair>
1578 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1580 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
1605 {
return _M_h.insert(__hint, __x); }
1611 {
return _M_h.insert(__hint,
std::move(__x)); }
1613 template<
typename _Pair>
1614 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1616 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
1628 template<
typename _InputIterator>
1630 insert(_InputIterator __first, _InputIterator __last)
1631 { _M_h.insert(__first, __last); }
1643 { _M_h.insert(__l); }
1645 #if __cplusplus > 201402L
1650 __glibcxx_assert(__pos !=
end());
1651 return _M_h.extract(__pos);
1657 {
return _M_h.extract(__key); }
1662 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1667 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1686 {
return _M_h.erase(__position); }
1691 {
return _M_h.erase(__position); }
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>
1762 = _Hash_merge_helper<unordered_multimap, _H2, _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); }
2031 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
2035 _Hash1, _Pred1, _Alloc1>&,
2037 _Hash1, _Pred1, _Alloc1>&);
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