30#ifndef _UNORDERED_MAP_H
31#define _UNORDERED_MAP_H
33namespace std _GLIBCXX_VISIBILITY(default)
35_GLIBCXX_BEGIN_NAMESPACE_VERSION
36_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
42 template<
typename _Key,
49 _Alloc, __detail::_Select1st,
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;
171 template<
typename _InputIterator>
177 : _M_h(__first, __last, __n,
__hf,
__eql, __a)
212 noexcept(
noexcept(_Hashtable(std::move(__umap._M_h), __a)) )
213 : _M_h(std::move(__umap._M_h), __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>
417 template<
typename...
_Args>
422#if __cplusplus > 201402L
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)
487 template <
typename... _Args>
489 try_emplace(
key_type&& __k, _Args&&... __args)
532 template <
typename... _Args>
547 template <
typename... _Args>
581 {
return _M_h.insert(__x); }
587 {
return _M_h.insert(std::move(__x)); }
589 template<
typename _Pair>
620 {
return _M_h.insert(
__hint, __x); }
626 {
return _M_h.insert(
__hint, std::move(__x)); }
628 template<
typename _Pair>
643 template<
typename _InputIterator>
646 { _M_h.insert(__first, __last); }
657 { _M_h.insert(
__l); }
660#if __cplusplus > 201402L
661#define __cpp_lib_unordered_map_insertion 201411
682 template <
typename _Obj>
700 template <
typename _Obj>
702 insert_or_assign(
key_type&& __k, _Obj&& __obj)
743 template <
typename _Obj>
761 template <
typename _Obj>
816 {
return _M_h.erase(__x); }
834 {
return _M_h.erase(__first, __last); }
858 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
859 { _M_h.swap(__x._M_h); }
861#if __cplusplus > 201402L
862 template<
typename,
typename,
typename>
865 template<
typename _H2,
typename _P2>
870 _M_h._M_merge_unique(_Merge_helper::_S_get_table(
__source));
873 template<
typename _H2,
typename _P2>
875 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
878 template<
typename _H2,
typename _P2>
880 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
882 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
883 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
886 template<
typename _H2,
typename _P2>
888 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
898 {
return _M_h.hash_function(); }
904 {
return _M_h.key_eq(); }
922 {
return _M_h.find(__x); }
926 {
return _M_h.find(__x); }
940 {
return _M_h.count(__x); }
942#if __cplusplus > 201703L
950 {
return _M_h.find(__x) != _M_h.end(); }
964 {
return _M_h.equal_range(__x); }
968 {
return _M_h.equal_range(__x); }
986 {
return _M_h[
__k]; }
990 {
return _M_h[std::move(
__k)]; }
1003 {
return _M_h.at(
__k); }
1007 {
return _M_h.at(
__k); }
1015 {
return _M_h.bucket_count(); }
1020 {
return _M_h.max_bucket_count(); }
1029 {
return _M_h.bucket_size(__n); }
1037 bucket(
const key_type& __key)
const
1038 {
return _M_h.bucket(__key); }
1048 {
return _M_h.begin(__n); }
1059 {
return _M_h.begin(__n); }
1063 {
return _M_h.cbegin(__n); }
1074 {
return _M_h.end(__n); }
1085 {
return _M_h.end(__n); }
1089 {
return _M_h.cend(__n); }
1097 {
return _M_h.load_factor(); }
1103 {
return _M_h.max_load_factor(); }
1111 { _M_h.max_load_factor(
__z); }
1122 { _M_h.rehash(__n); }
1133 { _M_h.reserve(__n); }
1142#if __cpp_deduction_guides >= 201606
1144 template<
typename _InputIterator,
1145 typename _Hash = hash<__iter_key_t<_InputIterator>>,
1146 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
1147 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
1148 typename = _RequireInputIter<_InputIterator>,
1149 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1150 typename = _RequireNotAllocator<_Pred>,
1151 typename = _RequireAllocator<_Allocator>>
1152 unordered_map(_InputIterator, _InputIterator,
1154 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1155 -> unordered_map<__iter_key_t<_InputIterator>,
1156 __iter_val_t<_InputIterator>,
1157 _Hash, _Pred, _Allocator>;
1159 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1160 typename _Pred = equal_to<_Key>,
1161 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1162 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1163 typename = _RequireNotAllocator<_Pred>,
1164 typename = _RequireAllocator<_Allocator>>
1165 unordered_map(initializer_list<pair<_Key, _Tp>>,
1167 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1168 -> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
1170 template<
typename _InputIterator,
typename _Allocator,
1171 typename = _RequireInputIter<_InputIterator>,
1172 typename = _RequireAllocator<_Allocator>>
1173 unordered_map(_InputIterator, _InputIterator,
1175 -> unordered_map<__iter_key_t<_InputIterator>,
1176 __iter_val_t<_InputIterator>,
1177 hash<__iter_key_t<_InputIterator>>,
1178 equal_to<__iter_key_t<_InputIterator>>,
1181 template<
typename _InputIterator,
typename _Allocator,
1182 typename = _RequireInputIter<_InputIterator>,
1183 typename = _RequireAllocator<_Allocator>>
1184 unordered_map(_InputIterator, _InputIterator, _Allocator)
1185 -> unordered_map<__iter_key_t<_InputIterator>,
1186 __iter_val_t<_InputIterator>,
1187 hash<__iter_key_t<_InputIterator>>,
1188 equal_to<__iter_key_t<_InputIterator>>,
1191 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1192 typename = _RequireInputIter<_InputIterator>,
1193 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1194 typename = _RequireAllocator<_Allocator>>
1195 unordered_map(_InputIterator, _InputIterator,
1198 -> unordered_map<__iter_key_t<_InputIterator>,
1199 __iter_val_t<_InputIterator>, _Hash,
1200 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1202 template<
typename _Key,
typename _Tp,
typename _Allocator,
1203 typename = _RequireAllocator<_Allocator>>
1204 unordered_map(initializer_list<pair<_Key, _Tp>>,
1207 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1209 template<
typename _Key,
typename _Tp,
typename _Allocator,
1210 typename = _RequireAllocator<_Allocator>>
1211 unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
1212 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1214 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1215 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1216 typename = _RequireAllocator<_Allocator>>
1217 unordered_map(initializer_list<pair<_Key, _Tp>>,
1220 -> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
1247 template<
typename _Key,
typename _Tp,
1248 typename _Hash = hash<_Key>,
1249 typename _Pred = equal_to<_Key>,
1250 typename _Alloc = allocator<std::pair<const _Key, _Tp>>>
1282#if __cplusplus > 201402L
1283 using node_type =
typename _Hashtable::node_type;
1319 template<
typename _InputIterator>
1325 : _M_h(__first, __last, __n,
__hf,
__eql, __a)
1360 noexcept(
noexcept(_Hashtable(std::move(__ummap._M_h), __a)) )
1361 : _M_h(std::move(__ummap._M_h), __a)
1392 template<
typename _InputIterator>
1399 template<
typename _InputIterator>
1447 {
return _M_h.get_allocator(); }
1452 _GLIBCXX_NODISCARD
bool
1454 {
return _M_h.empty(); }
1459 {
return _M_h.size(); }
1464 {
return _M_h.max_size(); }
1474 {
return _M_h.begin(); }
1483 {
return _M_h.begin(); }
1487 {
return _M_h.begin(); }
1496 {
return _M_h.end(); }
1505 {
return _M_h.end(); }
1509 {
return _M_h.end(); }
1529 template<
typename...
_Args>
1556 template<
typename...
_Args>
1573 {
return _M_h.insert(__x); }
1577 {
return _M_h.insert(std::move(__x)); }
1579 template<
typename _Pair>
1607 {
return _M_h.insert(
__hint, __x); }
1613 {
return _M_h.insert(
__hint, std::move(__x)); }
1615 template<
typename _Pair>
1630 template<
typename _InputIterator>
1633 { _M_h.insert(__first, __last); }
1645 { _M_h.insert(
__l); }
1647#if __cplusplus > 201402L
1653 return _M_h.extract(
__pos);
1659 {
return _M_h.extract(__key); }
1664 {
return _M_h._M_reinsert_node_multi(
cend(), std::move(__nh)); }
1669 {
return _M_h._M_reinsert_node_multi(__hint, std::move(__nh)); }
1709 {
return _M_h.erase(__x); }
1728 {
return _M_h.erase(__first, __last); }
1752 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
1753 { _M_h.swap(__x._M_h); }
1755#if __cplusplus > 201402L
1756 template<
typename,
typename,
typename>
1759 template<
typename _H2,
typename _P2>
1765 _M_h._M_merge_multi(_Merge_helper::_S_get_table(
__source));
1768 template<
typename _H2,
typename _P2>
1770 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1771 { merge(__source); }
1773 template<
typename _H2,
typename _P2>
1775 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
1778 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1779 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1782 template<
typename _H2,
typename _P2>
1784 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1785 { merge(__source); }
1794 {
return _M_h.hash_function(); }
1800 {
return _M_h.key_eq(); }
1818 {
return _M_h.find(__x); }
1822 {
return _M_h.find(__x); }
1832 {
return _M_h.count(__x); }
1834#if __cplusplus > 201703L
1841 contains(
const key_type& __x)
const
1842 {
return _M_h.find(__x) != _M_h.end(); }
1854 {
return _M_h.equal_range(__x); }
1858 {
return _M_h.equal_range(__x); }
1866 {
return _M_h.bucket_count(); }
1871 {
return _M_h.max_bucket_count(); }
1880 {
return _M_h.bucket_size(__n); }
1888 bucket(
const key_type& __key)
const
1889 {
return _M_h.bucket(__key); }
1899 {
return _M_h.begin(__n); }
1910 {
return _M_h.begin(__n); }
1914 {
return _M_h.cbegin(__n); }
1925 {
return _M_h.end(__n); }
1936 {
return _M_h.end(__n); }
1940 {
return _M_h.cend(__n); }
1948 {
return _M_h.load_factor(); }
1954 {
return _M_h.max_load_factor(); }
1962 { _M_h.max_load_factor(
__z); }
1973 { _M_h.rehash(__n); }
1984 { _M_h.reserve(__n); }
1995#if __cpp_deduction_guides >= 201606
1997 template<
typename _InputIterator,
1998 typename _Hash = hash<__iter_key_t<_InputIterator>>,
1999 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
2000 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
2001 typename = _RequireInputIter<_InputIterator>,
2002 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2003 typename = _RequireNotAllocator<_Pred>,
2004 typename = _RequireAllocator<_Allocator>>
2005 unordered_multimap(_InputIterator, _InputIterator,
2007 _Hash = _Hash(), _Pred = _Pred(),
2008 _Allocator = _Allocator())
2009 -> unordered_multimap<__iter_key_t<_InputIterator>,
2010 __iter_val_t<_InputIterator>, _Hash, _Pred,
2013 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
2014 typename _Pred = equal_to<_Key>,
2015 typename _Allocator = allocator<pair<const _Key, _Tp>>,
2016 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2017 typename = _RequireNotAllocator<_Pred>,
2018 typename = _RequireAllocator<_Allocator>>
2019 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2021 _Hash = _Hash(), _Pred = _Pred(),
2022 _Allocator = _Allocator())
2023 -> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
2025 template<
typename _InputIterator,
typename _Allocator,
2026 typename = _RequireInputIter<_InputIterator>,
2027 typename = _RequireAllocator<_Allocator>>
2028 unordered_multimap(_InputIterator, _InputIterator,
2030 -> unordered_multimap<__iter_key_t<_InputIterator>,
2031 __iter_val_t<_InputIterator>,
2032 hash<__iter_key_t<_InputIterator>>,
2033 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2035 template<
typename _InputIterator,
typename _Allocator,
2036 typename = _RequireInputIter<_InputIterator>,
2037 typename = _RequireAllocator<_Allocator>>
2038 unordered_multimap(_InputIterator, _InputIterator, _Allocator)
2039 -> unordered_multimap<__iter_key_t<_InputIterator>,
2040 __iter_val_t<_InputIterator>,
2041 hash<__iter_key_t<_InputIterator>>,
2042 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2044 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
2045 typename = _RequireInputIter<_InputIterator>,
2046 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2047 typename = _RequireAllocator<_Allocator>>
2048 unordered_multimap(_InputIterator, _InputIterator,
2051 -> unordered_multimap<__iter_key_t<_InputIterator>,
2052 __iter_val_t<_InputIterator>, _Hash,
2053 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2055 template<
typename _Key,
typename _Tp,
typename _Allocator,
2056 typename = _RequireAllocator<_Allocator>>
2057 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2060 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2062 template<
typename _Key,
typename _Tp,
typename _Allocator,
2063 typename = _RequireAllocator<_Allocator>>
2064 unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
2065 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
2067 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
2068 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2069 typename = _RequireAllocator<_Allocator>>
2070 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
2073 -> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
2077 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2079 swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2080 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2081 noexcept(
noexcept(__x.swap(__y)))
2084 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2086 swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2087 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2088 noexcept(
noexcept(__x.swap(__y)))
2091 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2093 operator==(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2094 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2095 {
return __x._M_h._M_equal(__y._M_h); }
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); }
2103 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2105 operator==(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2106 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2107 {
return __x._M_h._M_equal(__y._M_h); }
2109 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2111 operator!=(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
2112 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
2113 {
return !(__x == __y); }
2115_GLIBCXX_END_NAMESPACE_CONTAINER
2117#if __cplusplus > 201402L
2119 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2120 typename _Alloc,
typename _Hash2,
typename _Eq2>
2121 struct _Hash_merge_helper<
2122 _GLIBCXX_STD_C::unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2126 template<
typename... _Tp>
2127 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2128 template<
typename... _Tp>
2129 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2131 friend unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2134 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2135 {
return __map._M_h; }
2138 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2139 {
return __map._M_h; }
2143 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2144 typename _Alloc,
typename _Hash2,
typename _Eq2>
2145 struct _Hash_merge_helper<
2146 _GLIBCXX_STD_C::unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2150 template<
typename... _Tp>
2151 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2152 template<
typename... _Tp>
2153 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
2155 friend unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>;
2158 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2159 {
return __map._M_h; }
2162 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
2163 {
return __map._M_h; }
2167_GLIBCXX_END_NAMESPACE_VERSION
constexpr tuple< _Elements &&... > forward_as_tuple(_Elements &&... __args) noexcept
std::forward_as_tuple
_GLIBCXX17_INLINE constexpr piecewise_construct_t piecewise_construct
piecewise_construct
ISO C++ entities toplevel namespace is std.
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...
A standard container composed of equivalent keys (possibly containing multiple of each key value) tha...
float load_factor() const noexcept
Returns the average number of elements per bucket.
_Hashtable::reference reference
Iterator-related typedefs.
iterator erase(iterator __position)
Erases an element from an unordered_multimap.
const_iterator end() const noexcept
size_type erase(const key_type &__x)
Erases elements according to the provided key.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_multimap.
_Hashtable::iterator iterator
Iterator-related typedefs.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multimap.
iterator begin() noexcept
const_iterator begin() const noexcept
hasher hash_function() const
Returns the hash functor object with which the unordered_multimap was constructed.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(const_iterator __hint, _Pair &&__x)
Inserts a std::pair into the unordered_multimap.
unordered_multimap & operator=(const unordered_multimap &)=default
Copy assignment operator.
key_equal key_eq() const
Returns the key comparison object with which the unordered_multimap was constructed.
size_type count(const key_type &__x) const
Finds the number of elements.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_multimap.
_Hashtable::mapped_type mapped_type
Public typedefs.
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
unordered_multimap & operator=(initializer_list< value_type > __l)
Unordered_multimap list assignment operator.
unordered_multimap(size_type __n, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Default constructor creates no elements.
_Hashtable::value_type value_type
Public typedefs.
iterator emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
_GLIBCXX_NODISCARD bool empty() const noexcept
Returns true if the unordered_multimap is empty.
iterator erase(const_iterator __position)
Erases an element from an unordered_multimap.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
float max_load_factor() const noexcept
Returns a positive number that the unordered_multimap tries to keep the load factor less than or equa...
unordered_multimap()=default
Default constructor.
iterator insert(value_type &&__x)
Inserts a std::pair into the unordered_multimap.
iterator insert(const value_type &__x)
Inserts a std::pair into the unordered_multimap.
unordered_multimap & operator=(unordered_multimap &&)=default
Move assignment operator.
_Hashtable::hasher hasher
Public typedefs.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
void reserve(size_type __n)
Prepare the unordered_multimap for a specified number of elements.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_multimap from a range.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multimap.
unordered_multimap(initializer_list< value_type > __l, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_multimap from an initializer_list.
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.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(_Pair &&__x)
Inserts a std::pair into the unordered_multimap.
void swap(unordered_multimap &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_multimap.
void rehash(size_type __n)
May rehash the unordered_multimap.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_multimap.
const_iterator cend() const noexcept
size_type max_size() const noexcept
Returns the maximum size of the unordered_multimap.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
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.
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.
_Hashtable::iterator iterator
Iterator-related typedefs.
void max_load_factor(float __z)
Change the unordered_map maximum load factor.
const mapped_type & at(const key_type &__k) const
Access to unordered_map data.
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.
unordered_map & operator=(initializer_list< value_type > __l)
Unordered_map list assignment operator.
_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.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(const_iterator __hint, _Pair &&__x)
Attempts to insert a std::pair into the unordered_map.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
mapped_type & at(const key_type &__k)
Access to unordered_map data.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_map.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
void reserve(size_type __n)
Prepare the unordered_map for a specified number of elements.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
_Hashtable::reference reference
Iterator-related typedefs.
iterator insert(const_iterator __hint, const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::allocator_type allocator_type
Public typedefs.
unordered_map(const unordered_map &)=default
Copy constructor.
size_type count(const key_type &__x) const
Finds the number of elements.
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.
unordered_map & operator=(unordered_map &&)=default
Move assignment operator.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
unordered_map(size_type __n, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Default constructor creates no elements.
std::pair< iterator, bool > emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
size_type size() const noexcept
Returns the size of the unordered_map.
__enable_if_t< is_constructible< value_type, _Pair && >::value, pair< iterator, bool > > insert(_Pair &&__x)
Attempts to insert a std::pair into the unordered_map.
mapped_type & operator[](key_type &&__k)
Subscript ( [] ) access to unordered_map data.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::hasher hasher
Public typedefs.
unordered_map(_InputIterator __first, _InputIterator __last, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_map from a range.
mapped_type & operator[](const key_type &__k)
Subscript ( [] ) access to unordered_map data.
const_iterator begin() const noexcept
key_equal key_eq() const
Returns the key comparison object with which the unordered_map was constructed.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
_Hashtable::key_equal key_equal
Public typedefs.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
iterator erase(iterator __position)
Erases an element from an unordered_map.
const_iterator cend() const noexcept
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
_Hashtable::pointer pointer
Iterator-related typedefs.
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(initializer_list< value_type > __l, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_map from an initializer_list.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
_Hashtable::size_type size_type
Iterator-related typedefs.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_map.
float load_factor() const noexcept
Returns the average number of elements per bucket.
iterator erase(const_iterator __position)
Erases an element from an unordered_map.
void swap(unordered_map &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_map.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
float max_load_factor() const noexcept
Returns a positive number that the unordered_map tries to keep the load factor less than or equal to.
unordered_map & operator=(const unordered_map &)=default
Copy assignment operator.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
_GLIBCXX_NODISCARD bool empty() const noexcept
Returns true if the unordered_map is empty.
_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