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;
154 const hasher& __hf =
hasher(),
157 : _M_h(__n, __hf, __eql, __a)
173 template<
typename _InputIterator>
176 const hasher& __hf =
hasher(),
179 : _M_h(__first, __last, __n, __hf, __eql, __a)
203 const allocator_type& __a)
204 : _M_h(__umap._M_h, __a)
213 const allocator_type& __a)
214 noexcept( noexcept(_Hashtable(
std::move(__umap._M_h), __a)) )
231 const hasher& __hf =
hasher(),
234 : _M_h(__l, __n, __hf, __eql, __a)
242 const allocator_type& __a)
246 template<
typename _InputIterator>
249 const allocator_type& __a)
253 template<
typename _InputIterator>
255 size_type __n,
const hasher& __hf,
256 const allocator_type& __a)
262 const allocator_type& __a)
267 size_type __n,
const hasher& __hf,
268 const allocator_type& __a)
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>
527 try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __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)); }
592 insert(const_iterator __hint,
const value_type& __x)
593 {
return _M_h.insert(__hint, __x); }
598 insert(const_iterator __hint, value_type&& __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>
603 insert(const_iterator __hint, _Pair&& __x)
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); }
782 erase(const_iterator __first, const_iterator __last)
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>
827 template<
typename _H2,
typename _P2>
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>
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); }
881 find(
const key_type& __x)
const 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]; }
998 at(
const key_type& __k)
999 {
return _M_h.at(__k); }
1002 at(
const key_type& __k)
const 1003 {
return _M_h.at(__k); }
1011 {
return _M_h.bucket_count(); }
1016 {
return _M_h.max_bucket_count(); }
1024 bucket_size(size_type __n)
const 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); }
1053 const_local_iterator
1055 {
return _M_h.begin(__n); }
1057 const_local_iterator
1059 {
return _M_h.cbegin(__n); }
1070 {
return _M_h.end(__n); }
1079 const_local_iterator
1081 {
return _M_h.end(__n); }
1083 const_local_iterator
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,
1144 typename = _RequireInputIter<_InputIterator>,
1145 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1146 typename = _RequireNotAllocator<_Pred>,
1147 typename = _RequireAllocator<_Allocator>>
1150 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
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>>
1163 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1166 template<
typename _InputIterator,
typename _Allocator,
1167 typename = _RequireInputIter<_InputIterator>,
1168 typename = _RequireAllocator<_Allocator>>
1172 __iter_val_t<_InputIterator>,
1177 template<
typename _InputIterator,
typename _Allocator,
1178 typename = _RequireInputIter<_InputIterator>,
1179 typename = _RequireAllocator<_Allocator>>
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>>
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>>
1205 template<
typename _Key,
typename _Tp,
typename _Allocator,
1206 typename = _RequireAllocator<_Allocator>>
1210 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1211 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1212 typename = _RequireAllocator<_Allocator>>
1245 template<
typename _Key,
typename _Tp,
1247 typename _Pred = equal_to<_Key>,
1251 typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
1280 #if __cplusplus > 201402L 1281 using node_type =
typename _Hashtable::node_type;
1298 const hasher& __hf =
hasher(),
1301 : _M_h(__n, __hf, __eql, __a)
1317 template<
typename _InputIterator>
1320 const hasher& __hf =
hasher(),
1323 : _M_h(__first, __last, __n, __hf, __eql, __a)
1347 const allocator_type& __a)
1348 : _M_h(__ummap._M_h, __a)
1357 const allocator_type& __a)
1358 noexcept( noexcept(_Hashtable(
std::move(__ummap._M_h), __a)) )
1375 const hasher& __hf =
hasher(),
1378 : _M_h(__l, __n, __hf, __eql, __a)
1386 const allocator_type& __a)
1390 template<
typename _InputIterator>
1393 const allocator_type& __a)
1397 template<
typename _InputIterator>
1399 size_type __n,
const hasher& __hf,
1400 const allocator_type& __a)
1406 const allocator_type& __a)
1411 size_type __n,
const hasher& __hf,
1412 const allocator_type& __a)
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)); }
1604 insert(const_iterator __hint,
const value_type& __x)
1605 {
return _M_h.insert(__hint, __x); }
1610 insert(const_iterator __hint, value_type&& __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)); }
1666 insert(const_iterator __hint, node_type&& __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); }
1725 erase(const_iterator __first, const_iterator __last)
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>
1769 { merge(__source); }
1771 template<
typename _H2,
typename _P2>
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>
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(); }
1924 bucket_size(size_type __n)
const 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); }
1953 const_local_iterator
1955 {
return _M_h.begin(__n); }
1957 const_local_iterator
1959 {
return _M_h.cbegin(__n); }
1970 {
return _M_h.end(__n); }
1979 const_local_iterator
1981 {
return _M_h.end(__n); }
1983 const_local_iterator
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>>,
2046 typename = _RequireInputIter<_InputIterator>,
2047 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2048 typename = _RequireNotAllocator<_Pred>,
2049 typename = _RequireAllocator<_Allocator>>
2052 _Hash = _Hash(), _Pred = _Pred(),
2053 _Allocator = _Allocator())
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>>
2066 _Hash = _Hash(), _Pred = _Pred(),
2067 _Allocator = _Allocator())
2070 template<
typename _InputIterator,
typename _Allocator,
2071 typename = _RequireInputIter<_InputIterator>,
2072 typename = _RequireAllocator<_Allocator>>
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>>
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>>
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>>
2107 template<
typename _Key,
typename _Tp,
typename _Allocator,
2108 typename = _RequireAllocator<_Allocator>>
2112 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
2113 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2114 typename = _RequireAllocator<_Allocator>>
2122 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2126 noexcept(noexcept(__x.
swap(__y)))
2129 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2133 noexcept(noexcept(__x.
swap(__y)))
2136 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
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>
2147 {
return !(__x == __y); }
2150 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
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>
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>
2184 {
return __map._M_h; }
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<
2199 template<
typename... _Tp>
2200 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2201 template<
typename... _Tp>
2208 {
return __map._M_h; }
2212 {
return __map._M_h; }
2216 _GLIBCXX_END_NAMESPACE_VERSION
size_type count(const key_type &__x) const
Finds the number of elements.
iterator insert(const_iterator __hint, const value_type &__x)
Inserts a std::pair into the unordered_multimap.
key_equal key_eq() const
Returns the key comparison object with which the unordered_multimap was constructed.
iterator insert(const_iterator, node_type &&__nh)
Re-insert an extracted node.
unordered_map & operator=(const unordered_map &)=default
Copy assignment operator.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
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 erase(const key_type &__x)
Erases elements according to the provided key.
size_type max_size() const noexcept
Returns the maximum size of the unordered_multimap.
const_iterator end() const noexcept
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multimap.
_Hashtable::key_equal key_equal
Public typedefs.
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.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
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.
size_type size() const noexcept
Returns the size of the unordered_multimap.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
auto find(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_multimap.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
const_iterator cend() const noexcept
void reserve(size_type __n)
Prepare the unordered_multimap for a specified number of elements.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
iterator emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_map.
bool empty() const noexcept
Returns true if the unordered_multimap is empty.
insert_return_type insert(node_type &&__nh)
Re-insert an extracted node.
iterator insert(const_iterator __hint, const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::hasher hasher
Public typedefs.
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.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_map.
_Hashtable::iterator iterator
Iterator-related typedefs.
iterator try_emplace(const_iterator __hint, const key_type &__k, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_map.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
_Hashtable::key_type key_type
Public typedefs.
key_equal key_eq() const
Returns the key comparison object with which the unordered_map was constructed.
__detail::_Hashtable_traits< _Cache, false, false > __ummap_traits
Base types for unordered_multimap.
_Hashtable::mapped_type mapped_type
Public typedefs.
node_type extract(const key_type &__key)
Extract a node.
iterator erase(iterator __position)
Erases an element from an unordered_multimap.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_multimap.
iterator insert(value_type &&__x)
Inserts a std::pair into the unordered_multimap.
auto count(const _Kt &__x) const -> decltype(_M_h._M_count_tr(__x))
Finds the number of elements.
iterator erase(const_iterator __position)
Erases an element from an unordered_multimap.
node_type extract(const key_type &__key)
Extract a node.
unordered_multimap(const allocator_type &__a)
Creates an unordered_multimap with no elements.
iterator erase(iterator __position)
Erases an element from an unordered_map.
auto count(const _Kt &__x) const -> decltype(_M_h._M_count_tr(__x))
Finds the number of elements.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
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_multimap & operator=(initializer_list< value_type > __l)
Unordered_multimap list assignment operator.
_Hashtable::value_type value_type
Public typedefs.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_map.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multimap.
node_type extract(const_iterator __pos)
Extract a node.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
One of the comparison functors.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
void max_load_factor(float __z)
Change the unordered_multimap maximum load factor.
_Hashtable::value_type value_type
Public typedefs.
iterator insert(const_iterator __hint, value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
_Hashtable::size_type size_type
Iterator-related typedefs.
_Hashtable::reference reference
Iterator-related typedefs.
iterator begin() noexcept
float max_load_factor() const noexcept
Returns a positive number that the unordered_multimap tries to keep the load factor less than or equa...
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
void rehash(size_type __n)
May rehash the unordered_map.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(const_iterator __hint, _Pair &&__x)
Inserts a std::pair into the unordered_multimap.
ISO C++ entities toplevel namespace is std.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
iterator insert(const_iterator __hint, value_type &&__x)
Inserts a std::pair into the unordered_multimap.
_Hashtable::size_type size_type
Iterator-related typedefs.
_Hashtable::reference reference
Iterator-related typedefs.
const_iterator cbegin() const noexcept
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
auto contains(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x), void(), true)
Finds whether an element with the given key exists.
const_iterator cend() const noexcept
const mapped_type & at(const key_type &__k) const
Access to unordered_map data.
unordered_map & operator=(initializer_list< value_type > __l)
Unordered_map list assignment operator.
__detail::_Hashtable_traits< _Cache, false, true > __umap_traits
Base types for unordered_map.
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
mapped_type & operator[](const key_type &__k)
Subscript ( [] ) access to unordered_map data.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
float load_factor() const noexcept
Returns the average number of elements per bucket.
mapped_type & at(const key_type &__k)
Access to unordered_map data.
void swap(unordered_multimap &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_multimap.
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
auto equal_range(const _Kt &__x) -> decltype(_M_h._M_equal_range_tr(__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.
iterator erase(const_iterator __position)
Erases an element from an unordered_map.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
unordered_map()=default
Default constructor.
pair< iterator, bool > try_emplace(const key_type &__k, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
iterator insert(const_iterator __hint, node_type &&__nh)
Re-insert an extracted node.
const_iterator end() const noexcept
const_iterator begin() const noexcept
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(_Pair &&__x)
Inserts a std::pair into the unordered_multimap.
_Hashtable::allocator_type allocator_type
Public typedefs.
void reserve(size_type __n)
Prepare the unordered_map for a specified number of elements.
auto equal_range(const _Kt &__x) const -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
auto find(const _Kt &__x) -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_multimap.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
auto find(const _Kt &__x) -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_map.
auto equal_range(const _Kt &__x) const -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_multimap.
size_type count(const key_type &__x) const
Finds the number of elements.
void max_load_factor(float __z)
Change the unordered_map maximum load factor.
hasher hash_function() const
Returns the hash functor object with which the unordered_multimap was constructed.
A standard container composed of unique keys (containing at most one of each key value) that associat...
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
iterator insert(node_type &&__nh)
Re-insert an extracted node.
Struct holding two objects of arbitrary type.
The standard allocator, as per C++03 [20.4.1].
bool empty() const noexcept
Returns true if the unordered_map is empty.
size_type size() const noexcept
Returns the size of the unordered_map.
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
_Hashtable::allocator_type allocator_type
Public typedefs.
_Hashtable::hasher hasher
Public typedefs.
hasher hash_function() const
Returns the hash functor object with which the unordered_map was constructed.
void rehash(size_type __n)
May rehash the unordered_multimap.
node_type extract(const_iterator __pos)
Extract a node.
pair< iterator, bool > insert_or_assign(const key_type &__k, _Obj &&__obj)
Attempts to insert a std::pair into the unordered_map.
iterator insert_or_assign(const_iterator __hint, const key_type &__k, _Obj &&__obj)
Attempts to insert a std::pair into the unordered_map.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
std::pair< iterator, bool > emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
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.
_Hashtable::key_equal key_equal
Public typedefs.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_multimap.
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.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_multimap.
_Hashtable::pointer pointer
Iterator-related typedefs.
mapped_type & operator[](key_type &&__k)
Subscript ( [] ) access to unordered_map data.
__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.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets 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.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
_Hashtable::pointer pointer
Iterator-related typedefs.
const_iterator begin() const noexcept
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
const_iterator cbegin() const noexcept
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_map.
_Hashtable::iterator iterator
Iterator-related typedefs.
size_type max_size() const noexcept
Returns the maximum size of the unordered_map.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
unordered_map(const allocator_type &__a)
Creates an unordered_map with no elements.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_multimap.
float load_factor() const noexcept
Returns the average number of elements per bucket.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_map.
void swap(unordered_map &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_map.
_Hashtable::key_type key_type
Public typedefs.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
iterator insert(const value_type &__x)
Inserts a std::pair into the unordered_multimap.
iterator begin() noexcept
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.
A standard container composed of equivalent keys (possibly containing multiple of each key value) tha...
auto equal_range(const _Kt &__x) -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
_Hashtable::mapped_type mapped_type
Public typedefs.
Primary class template hash.
auto find(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_map.