30 #ifndef _UNORDERED_MAP_H 31 #define _UNORDERED_MAP_H 33 namespace std _GLIBCXX_VISIBILITY(default)
35 _GLIBCXX_BEGIN_NAMESPACE_VERSION
36 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
42 template<
typename _Key,
49 _Alloc, __detail::_Select1st,
59 template<
typename _Key,
66 _Alloc, __detail::_Select1st,
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>
98 template<
typename _Key,
typename _Tp,
114 typedef typename _Hashtable::hasher
hasher;
133 #if __cplusplus > 201402L 134 using node_type =
typename _Hashtable::node_type;
135 using insert_return_type =
typename _Hashtable::insert_return_type;
152 const hasher& __hf =
hasher(),
155 : _M_h(__n, __hf, __eql, __a)
171 template<
typename _InputIterator>
174 const hasher& __hf =
hasher(),
177 : _M_h(__first, __last, __n, __hf, __eql, __a)
201 const allocator_type& __a)
202 : _M_h(__umap._M_h, __a)
211 const allocator_type& __a)
212 : _M_h(std::move(__umap._M_h), __a)
228 const hasher& __hf =
hasher(),
231 : _M_h(__l, __n, __hf, __eql, __a)
239 const allocator_type& __a)
243 template<
typename _InputIterator>
246 const allocator_type& __a)
250 template<
typename _InputIterator>
252 size_type __n,
const hasher& __hf,
253 const allocator_type& __a)
259 const allocator_type& __a)
264 size_type __n,
const hasher& __hf,
265 const allocator_type& __a)
298 {
return _M_h.get_allocator(); }
305 {
return _M_h.empty(); }
310 {
return _M_h.size(); }
315 {
return _M_h.max_size(); }
325 {
return _M_h.begin(); }
334 {
return _M_h.begin(); }
338 {
return _M_h.begin(); }
347 {
return _M_h.end(); }
356 {
return _M_h.end(); }
360 {
return _M_h.end(); }
385 template<
typename... _Args>
388 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
416 template<
typename... _Args>
419 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
421 #if __cplusplus > 201402L 424 extract(const_iterator __pos)
426 __glibcxx_assert(__pos !=
end());
427 return _M_h.extract(__pos);
432 extract(
const key_type& __key)
433 {
return _M_h.extract(__key); }
438 {
return _M_h._M_reinsert_node(std::move(__nh)); }
442 insert(const_iterator, node_type&& __nh)
443 {
return _M_h._M_reinsert_node(std::move(__nh)).position; }
445 #define __cpp_lib_unordered_map_try_emplace 201411 468 template <
typename... _Args>
470 try_emplace(
const key_type& __k, _Args&&... __args)
472 iterator __i =
find(__k);
476 std::forward_as_tuple(__k),
477 std::forward_as_tuple(
478 std::forward<_Args>(__args)...))
486 template <
typename... _Args>
488 try_emplace(key_type&& __k, _Args&&... __args)
490 iterator __i =
find(__k);
494 std::forward_as_tuple(std::move(__k)),
495 std::forward_as_tuple(
496 std::forward<_Args>(__args)...))
531 template <
typename... _Args>
533 try_emplace(const_iterator __hint,
const key_type& __k,
536 iterator __i =
find(__k);
539 std::forward_as_tuple(__k),
540 std::forward_as_tuple(
541 std::forward<_Args>(__args)...));
546 template <
typename... _Args>
548 try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
550 iterator __i =
find(__k);
553 std::forward_as_tuple(std::move(__k)),
554 std::forward_as_tuple(
555 std::forward<_Args>(__args)...));
580 {
return _M_h.insert(__x); }
586 {
return _M_h.insert(std::move(__x)); }
588 template<
typename _Pair,
typename =
typename 590 _Pair&&>::value>::type>
593 {
return _M_h.insert(std::forward<_Pair>(__x)); }
619 insert(const_iterator __hint,
const value_type& __x)
620 {
return _M_h.insert(__hint, __x); }
625 insert(const_iterator __hint, value_type&& __x)
626 {
return _M_h.insert(__hint, std::move(__x)); }
628 template<
typename _Pair,
typename =
typename 630 _Pair&&>::value>::type>
632 insert(const_iterator __hint, _Pair&& __x)
633 {
return _M_h.insert(__hint, std::forward<_Pair>(__x)); }
645 template<
typename _InputIterator>
647 insert(_InputIterator __first, _InputIterator __last)
648 { _M_h.insert(__first, __last); }
659 { _M_h.insert(__l); }
662 #if __cplusplus > 201402L 663 #define __cpp_lib_unordered_map_insertion 201411 684 template <
typename _Obj>
686 insert_or_assign(
const key_type& __k, _Obj&& __obj)
688 iterator __i =
find(__k);
692 std::forward_as_tuple(__k),
693 std::forward_as_tuple(std::forward<_Obj>(__obj)))
697 (*__i).second = std::forward<_Obj>(__obj);
702 template <
typename _Obj>
704 insert_or_assign(key_type&& __k, _Obj&& __obj)
706 iterator __i =
find(__k);
710 std::forward_as_tuple(std::move(__k)),
711 std::forward_as_tuple(std::forward<_Obj>(__obj)))
715 (*__i).second = std::forward<_Obj>(__obj);
745 template <
typename _Obj>
747 insert_or_assign(const_iterator __hint,
const key_type& __k,
750 iterator __i =
find(__k);
754 std::forward_as_tuple(__k),
755 std::forward_as_tuple(
756 std::forward<_Obj>(__obj)));
758 (*__i).second = std::forward<_Obj>(__obj);
763 template <
typename _Obj>
765 insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
767 iterator __i =
find(__k);
771 std::forward_as_tuple(std::move(__k)),
772 std::forward_as_tuple(
773 std::forward<_Obj>(__obj)));
775 (*__i).second = std::forward<_Obj>(__obj);
796 {
return _M_h.erase(__position); }
801 {
return _M_h.erase(__position); }
818 {
return _M_h.erase(__x); }
835 erase(const_iterator __first, const_iterator __last)
836 {
return _M_h.erase(__first, __last); }
860 noexcept( noexcept(_M_h.swap(__x._M_h)) )
861 { _M_h.swap(__x._M_h); }
863 #if __cplusplus > 201402L 864 template<
typename,
typename,
typename>
865 friend class _Hash_merge_helper;
867 template<
typename _H2,
typename _P2>
871 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
872 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
875 template<
typename _H2,
typename _P2>
880 template<
typename _H2,
typename _P2>
884 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
885 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
888 template<
typename _H2,
typename _P2>
900 {
return _M_h.hash_function(); }
906 {
return _M_h.key_eq(); }
924 {
return _M_h.find(__x); }
927 find(
const key_type& __x)
const 928 {
return _M_h.find(__x); }
942 {
return _M_h.count(__x); }
955 {
return _M_h.equal_range(__x); }
959 {
return _M_h.equal_range(__x); }
977 {
return _M_h[__k]; }
981 {
return _M_h[std::move(__k)]; }
993 at(
const key_type& __k)
994 {
return _M_h.at(__k); }
997 at(
const key_type& __k)
const 998 {
return _M_h.at(__k); }
1006 {
return _M_h.bucket_count(); }
1011 {
return _M_h.max_bucket_count(); }
1019 bucket_size(size_type __n)
const 1020 {
return _M_h.bucket_size(__n); }
1028 bucket(
const key_type& __key)
const 1029 {
return _M_h.bucket(__key); }
1039 {
return _M_h.begin(__n); }
1048 const_local_iterator
1050 {
return _M_h.begin(__n); }
1052 const_local_iterator
1054 {
return _M_h.cbegin(__n); }
1065 {
return _M_h.end(__n); }
1074 const_local_iterator
1076 {
return _M_h.end(__n); }
1078 const_local_iterator
1080 {
return _M_h.cend(__n); }
1088 {
return _M_h.load_factor(); }
1094 {
return _M_h.max_load_factor(); }
1102 { _M_h.max_load_factor(__z); }
1113 { _M_h.rehash(__n); }
1124 { _M_h.reserve(__n); }
1126 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1133 #if __cpp_deduction_guides >= 201606 1135 template<
typename _InputIterator,
1139 typename = _RequireInputIter<_InputIterator>,
1140 typename = _RequireAllocator<_Allocator>>
1143 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1145 __iter_val_t<_InputIterator>,
1146 _Hash, _Pred, _Allocator>;
1148 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1149 typename _Pred = equal_to<_Key>,
1150 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1151 typename = _RequireAllocator<_Allocator>>
1154 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1157 template<
typename _InputIterator,
typename _Allocator,
1158 typename = _RequireInputIter<_InputIterator>,
1159 typename = _RequireAllocator<_Allocator>>
1163 __iter_val_t<_InputIterator>,
1168 template<
typename _InputIterator,
typename _Allocator,
1169 typename = _RequireInputIter<_InputIterator>,
1170 typename = _RequireAllocator<_Allocator>>
1173 __iter_val_t<_InputIterator>,
1174 hash<__iter_key_t<_InputIterator>>,
1175 equal_to<__iter_key_t<_InputIterator>>,
1178 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1179 typename = _RequireInputIter<_InputIterator>,
1180 typename = _RequireAllocator<_Allocator>>
1185 __iter_val_t<_InputIterator>, _Hash,
1186 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1188 template<
typename _Key,
typename _Tp,
typename _Allocator,
1189 typename = _RequireAllocator<_Allocator>>
1195 template<
typename _Key,
typename _Tp,
typename _Allocator,
1196 typename = _RequireAllocator<_Allocator>>
1200 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1201 typename = _RequireAllocator<_Allocator>>
1232 template<
typename _Key,
typename _Tp,
1234 typename _Pred = equal_to<_Key>,
1267 #if __cplusplus > 201402L 1268 using node_type =
typename _Hashtable::node_type;
1285 const hasher& __hf =
hasher(),
1288 : _M_h(__n, __hf, __eql, __a)
1304 template<
typename _InputIterator>
1307 const hasher& __hf =
hasher(),
1310 : _M_h(__first, __last, __n, __hf, __eql, __a)
1334 const allocator_type& __a)
1335 : _M_h(__ummap._M_h, __a)
1344 const allocator_type& __a)
1345 : _M_h(std::move(__ummap._M_h), __a)
1361 const hasher& __hf =
hasher(),
1364 : _M_h(__l, __n, __hf, __eql, __a)
1372 const allocator_type& __a)
1376 template<
typename _InputIterator>
1379 const allocator_type& __a)
1383 template<
typename _InputIterator>
1385 size_type __n,
const hasher& __hf,
1386 const allocator_type& __a)
1392 const allocator_type& __a)
1397 size_type __n,
const hasher& __hf,
1398 const allocator_type& __a)
1431 {
return _M_h.get_allocator(); }
1438 {
return _M_h.empty(); }
1443 {
return _M_h.size(); }
1448 {
return _M_h.max_size(); }
1458 {
return _M_h.begin(); }
1467 {
return _M_h.begin(); }
1471 {
return _M_h.begin(); }
1480 {
return _M_h.end(); }
1489 {
return _M_h.end(); }
1493 {
return _M_h.end(); }
1513 template<
typename... _Args>
1516 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1540 template<
typename... _Args>
1543 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1557 {
return _M_h.insert(__x); }
1561 {
return _M_h.insert(std::move(__x)); }
1563 template<
typename _Pair,
typename =
typename 1565 _Pair&&>::value>::type>
1568 {
return _M_h.insert(std::forward<_Pair>(__x)); }
1592 insert(const_iterator __hint,
const value_type& __x)
1593 {
return _M_h.insert(__hint, __x); }
1598 insert(const_iterator __hint, value_type&& __x)
1599 {
return _M_h.insert(__hint, std::move(__x)); }
1601 template<
typename _Pair,
typename =
typename 1603 _Pair&&>::value>::type>
1606 {
return _M_h.insert(__hint, std::forward<_Pair>(__x)); }
1618 template<
typename _InputIterator>
1620 insert(_InputIterator __first, _InputIterator __last)
1621 { _M_h.insert(__first, __last); }
1633 { _M_h.insert(__l); }
1635 #if __cplusplus > 201402L 1638 extract(const_iterator __pos)
1640 __glibcxx_assert(__pos !=
end());
1641 return _M_h.extract(__pos);
1646 extract(
const key_type& __key)
1647 {
return _M_h.extract(__key); }
1652 {
return _M_h._M_reinsert_node_multi(
cend(), std::move(__nh)); }
1656 insert(const_iterator __hint, node_type&& __nh)
1657 {
return _M_h._M_reinsert_node_multi(__hint, std::move(__nh)); }
1676 {
return _M_h.erase(__position); }
1681 {
return _M_h.erase(__position); }
1697 {
return _M_h.erase(__x); }
1715 erase(const_iterator __first, const_iterator __last)
1716 {
return _M_h.erase(__first, __last); }
1740 noexcept( noexcept(_M_h.swap(__x._M_h)) )
1741 { _M_h.swap(__x._M_h); }
1743 #if __cplusplus > 201402L 1744 template<
typename,
typename,
typename>
1745 friend class _Hash_merge_helper;
1747 template<
typename _H2,
typename _P2>
1752 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1753 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1756 template<
typename _H2,
typename _P2>
1759 { merge(__source); }
1761 template<
typename _H2,
typename _P2>
1766 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1767 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1770 template<
typename _H2,
typename _P2>
1773 { merge(__source); }
1782 {
return _M_h.hash_function(); }
1788 {
return _M_h.key_eq(); }
1806 {
return _M_h.find(__x); }
1810 {
return _M_h.find(__x); }
1820 {
return _M_h.count(__x); }
1831 {
return _M_h.equal_range(__x); }
1835 {
return _M_h.equal_range(__x); }
1843 {
return _M_h.bucket_count(); }
1848 {
return _M_h.max_bucket_count(); }
1856 bucket_size(size_type __n)
const 1857 {
return _M_h.bucket_size(__n); }
1865 bucket(
const key_type& __key)
const 1866 {
return _M_h.bucket(__key); }
1876 {
return _M_h.begin(__n); }
1885 const_local_iterator
1887 {
return _M_h.begin(__n); }
1889 const_local_iterator
1891 {
return _M_h.cbegin(__n); }
1902 {
return _M_h.end(__n); }
1911 const_local_iterator
1913 {
return _M_h.end(__n); }
1915 const_local_iterator
1917 {
return _M_h.cend(__n); }
1925 {
return _M_h.load_factor(); }
1931 {
return _M_h.max_load_factor(); }
1939 { _M_h.max_load_factor(__z); }
1950 { _M_h.rehash(__n); }
1961 { _M_h.reserve(__n); }
1963 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1967 _Hash1, _Pred1, _Alloc1>&,
1969 _Hash1, _Pred1, _Alloc1>&);
1972 #if __cpp_deduction_guides >= 201606 1974 template<
typename _InputIterator,
1975 typename _Hash = hash<__iter_key_t<_InputIterator>>,
1976 typename _Pred = equal_to<__iter_key_t<_InputIterator>>,
1978 typename = _RequireInputIter<_InputIterator>,
1979 typename = _RequireAllocator<_Allocator>>
1982 _Hash = _Hash(), _Pred = _Pred(),
1983 _Allocator = _Allocator())
1985 __iter_val_t<_InputIterator>, _Hash, _Pred,
1988 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1989 typename _Pred = equal_to<_Key>,
1990 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1991 typename = _RequireAllocator<_Allocator>>
1994 _Hash = _Hash(), _Pred = _Pred(),
1995 _Allocator = _Allocator())
1998 template<
typename _InputIterator,
typename _Allocator,
1999 typename = _RequireInputIter<_InputIterator>,
2000 typename = _RequireAllocator<_Allocator>>
2004 __iter_val_t<_InputIterator>,
2005 hash<__iter_key_t<_InputIterator>>,
2006 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2008 template<
typename _InputIterator,
typename _Allocator,
2009 typename = _RequireInputIter<_InputIterator>,
2010 typename = _RequireAllocator<_Allocator>>
2013 __iter_val_t<_InputIterator>,
2014 hash<__iter_key_t<_InputIterator>>,
2015 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2017 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
2018 typename = _RequireInputIter<_InputIterator>,
2019 typename = _RequireAllocator<_Allocator>>
2024 __iter_val_t<_InputIterator>, _Hash,
2025 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
2027 template<
typename _Key,
typename _Tp,
typename _Allocator,
2028 typename = _RequireAllocator<_Allocator>>
2034 template<
typename _Key,
typename _Tp,
typename _Allocator,
2035 typename = _RequireAllocator<_Allocator>>
2039 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
2040 typename = _RequireAllocator<_Allocator>>
2048 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2052 noexcept(noexcept(__x.
swap(__y)))
2055 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2059 noexcept(noexcept(__x.
swap(__y)))
2062 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2066 {
return __x._M_h._M_equal(__y._M_h); }
2068 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2072 {
return !(__x == __y); }
2074 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2078 {
return __x._M_h._M_equal(__y._M_h); }
2080 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
2084 {
return !(__x == __y); }
2086 _GLIBCXX_END_NAMESPACE_CONTAINER
2088 #if __cplusplus > 201402L 2090 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2091 typename _Alloc,
typename _Hash2,
typename _Eq2>
2092 struct _Hash_merge_helper<
2093 _GLIBCXX_STD_C::
unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
2097 template<
typename... _Tp>
2098 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2099 template<
typename... _Tp>
2106 {
return __map._M_h; }
2110 {
return __map._M_h; }
2114 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
2115 typename _Alloc,
typename _Hash2,
typename _Eq2>
2116 struct _Hash_merge_helper<
2121 template<
typename... _Tp>
2122 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
2123 template<
typename... _Tp>
2130 {
return __map._M_h; }
2134 {
return __map._M_h; }
2138 _GLIBCXX_END_NAMESPACE_VERSION
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.
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
iterator begin() noexcept
Default value for rehash policy. Bucket size is (usually) the smallest prime that keeps the load fact...
iterator insert(const_iterator __hint, const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::iterator iterator
Iterator-related typedefs.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
_Hashtable::reference reference
Iterator-related typedefs.
const_iterator cbegin() const noexcept
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
size_type max_size() const noexcept
Returns the maximum size of the unordered_map.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
iterator erase(iterator __position)
Erases an element from an unordered_map.
void max_load_factor(float __z)
Change the unordered_map maximum load factor.
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_map.
const mapped_type & at(const key_type &__k) const
Access to unordered_map data.
Define a member typedef type only if a boolean constant is true.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
unordered_map(const allocator_type &__a)
Creates an unordered_map with no elements.
_Hashtable::size_type size_type
Iterator-related typedefs.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
float load_factor() const noexcept
Returns the average number of elements per bucket.
float max_load_factor() const noexcept
Returns a positive number that the unordered_multimap tries to keep the load factor less than or equa...
Primary class template hash.
iterator insert(const_iterator __hint, value_type &&__x)
Inserts a std::pair into the unordered_multimap.
size_type size() const noexcept
Returns the size of the unordered_multimap.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_multimap.
iterator emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_multimap.
const_iterator cbegin() const noexcept
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
const_iterator cend() const noexcept
_Hashtable::key_type key_type
Public typedefs.
void reserve(size_type __n)
Prepare the unordered_map for a specified number of elements.
iterator insert(_Pair &&__x)
Inserts a std::pair into the unordered_multimap.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_map.
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.
_Hashtable::mapped_type mapped_type
Public typedefs.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
void swap(unordered_multimap &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_multimap.
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::pointer pointer
Iterator-related typedefs.
const_iterator begin() const noexcept
void rehash(size_type __n)
May rehash the unordered_map.
iterator insert(const_iterator __hint, _Pair &&__x)
Inserts a std::pair into the unordered_multimap.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multimap.
_Hashtable::allocator_type allocator_type
Public typedefs.
A standard container composed of equivalent keys (possibly containing multiple of each key value) tha...
const_iterator end() const noexcept
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.
void reserve(size_type __n)
Prepare the unordered_multimap for a specified number of elements.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
_Hashtable::key_type key_type
Public typedefs.
_Hashtable::size_type size_type
Iterator-related typedefs.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
key_equal key_eq() const
Returns the key comparison object with which the unordered_map was constructed.
_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.
_Hashtable::hasher hasher
Public typedefs.
bool empty() const noexcept
Returns true if the unordered_map is empty.
_Hashtable::mapped_type mapped_type
Public typedefs.
_Hashtable::value_type value_type
Public typedefs.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_multimap.
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...
_Hashtable::iterator iterator
Iterator-related typedefs.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_multimap.
hasher hash_function() const
Returns the hash functor object with which the unordered_map was constructed.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
hasher hash_function() const
Returns the hash functor object with which the unordered_multimap was constructed.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
Struct holding two objects of arbitrary type.
_GLIBCXX17_INLINE constexpr piecewise_construct_t piecewise_construct
piecewise_construct
ISO C++ entities toplevel namespace is std.
One of the comparison functors.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_map.
const_iterator cend() const noexcept
void max_load_factor(float __z)
Change the unordered_multimap maximum load factor.
size_type size() const noexcept
Returns the size of the unordered_map.
_Hashtable::key_equal key_equal
Public typedefs.
_Hashtable::pointer pointer
Iterator-related typedefs.
unordered_multimap(const allocator_type &__a)
Creates an unordered_multimap with no elements.
The standard allocator, as per [20.4].
Default ranged hash function H. In principle it should be a function object composed from objects of ...
mapped_type & operator[](key_type &&__k)
Subscript ( [] ) access to unordered_map data.
_Hashtable::reference reference
Iterator-related typedefs.
iterator insert(const_iterator __hint, _Pair &&__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
iterator insert(const value_type &__x)
Inserts a std::pair into the unordered_multimap.
bool empty() const noexcept
Returns true if the unordered_multimap is empty.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
A standard container composed of unique keys (containing at most one of each key value) that associat...
size_type count(const key_type &__x) const
Finds the number of elements.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
iterator insert(value_type &&__x)
Inserts a std::pair into the unordered_multimap.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_map.
_Hashtable::allocator_type allocator_type
Public typedefs.
_Hashtable::value_type value_type
Public typedefs.
const_iterator begin() const noexcept
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_multimap.
void rehash(size_type __n)
May rehash the unordered_multimap.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multimap.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
const_iterator end() const noexcept
key_equal key_eq() const
Returns the key comparison object with which the unordered_multimap was constructed.
size_type max_size() const noexcept
Returns the maximum size of the unordered_multimap.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
_Hashtable::hasher hasher
Public typedefs.
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::key_equal key_equal
Public typedefs.
mapped_type & at(const key_type &__k)
Access to unordered_map data.
unordered_map & operator=(initializer_list< value_type > __l)
Unordered_map list assignment operator.
iterator insert(const_iterator __hint, value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
size_type count(const key_type &__x) const
Finds the number of elements.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
unordered_map & operator=(const unordered_map &)=default
Copy assignment operator.
unordered_multimap & operator=(initializer_list< value_type > __l)
Unordered_multimap list assignment operator.
iterator erase(const_iterator __position)
Erases an element from an unordered_map.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
unordered_map()=default
Default constructor.
std::pair< iterator, bool > emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the unordered_map.
unordered_map(_InputIterator __first, _InputIterator __last, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_map from a range.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_map.
Default range hashing function: use division to fold a large number into the range [0...
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_multimap.
_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.
iterator erase(const_iterator __position)
Erases an element from an unordered_multimap.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
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(_Pair &&__x)
Attempts to insert a std::pair into the unordered_map.
iterator begin() noexcept
iterator insert(const_iterator __hint, const value_type &__x)
Inserts a std::pair into the unordered_multimap.
float load_factor() const noexcept
Returns the average number of elements per bucket.
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.
mapped_type & operator[](const key_type &__k)
Subscript ( [] ) access to unordered_map data.