30 #ifndef _UNORDERED_MAP_H
31 #define _UNORDERED_MAP_H
33 namespace std _GLIBCXX_VISIBILITY(default)
35 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
41 template<
typename _Key,
48 _Alloc, __detail::_Select1st,
58 template<
typename _Key,
65 _Alloc, __detail::_Select1st,
71 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
97 template<
class _Key,
class _Tp,
113 typedef typename _Hashtable::hasher
hasher;
132 #if __cplusplus > 201402L
133 using node_type =
typename _Hashtable::node_type;
134 using insert_return_type =
typename _Hashtable::insert_return_type;
154 : _M_h(__n, __hf, __eql, __a)
170 template<
typename _InputIterator>
176 : _M_h(__first, __last, __n, __hf, __eql, __a)
201 : _M_h(__umap._M_h, __a)
211 : _M_h(std::move(__umap._M_h), __a)
230 : _M_h(__l, __n, __hf, __eql, __a)
242 template<
typename _InputIterator>
249 template<
typename _InputIterator>
297 {
return _M_h.get_allocator(); }
304 {
return _M_h.empty(); }
309 {
return _M_h.size(); }
314 {
return _M_h.max_size(); }
324 {
return _M_h.begin(); }
333 {
return _M_h.begin(); }
337 {
return _M_h.begin(); }
346 {
return _M_h.end(); }
355 {
return _M_h.end(); }
359 {
return _M_h.end(); }
384 template<
typename... _Args>
387 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
415 template<
typename... _Args>
418 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
420 #if __cplusplus > 201402L
425 __glibcxx_assert(__pos !=
end());
426 return _M_h.extract(__pos);
432 {
return _M_h.extract(__key); }
437 {
return _M_h._M_reinsert_node(std::move(__nh)); }
442 {
return _M_h._M_reinsert_node(std::move(__nh)).position; }
444 #define __cpp_lib_unordered_map_try_emplace 201411
467 template <
typename... _Args>
469 try_emplace(
const key_type& __k, _Args&&... __args)
475 std::forward_as_tuple(__k),
476 std::forward_as_tuple(
477 std::forward<_Args>(__args)...))
485 template <
typename... _Args>
487 try_emplace(
key_type&& __k, _Args&&... __args)
493 std::forward_as_tuple(std::move(__k)),
494 std::forward_as_tuple(
495 std::forward<_Args>(__args)...))
530 template <
typename... _Args>
538 std::forward_as_tuple(__k),
539 std::forward_as_tuple(
540 std::forward<_Args>(__args)...));
545 template <
typename... _Args>
552 std::forward_as_tuple(std::move(__k)),
553 std::forward_as_tuple(
554 std::forward<_Args>(__args)...));
579 {
return _M_h.insert(__x); }
585 {
return _M_h.insert(std::move(__x)); }
587 template<
typename _Pair>
588 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
591 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
618 {
return _M_h.insert(__hint, __x); }
624 {
return _M_h.insert(__hint, std::move(__x)); }
626 template<
typename _Pair>
627 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
629 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
641 template<
typename _InputIterator>
643 insert(_InputIterator __first, _InputIterator __last)
644 { _M_h.insert(__first, __last); }
655 { _M_h.insert(__l); }
658 #if __cplusplus > 201402L
659 #define __cpp_lib_unordered_map_insertion 201411
680 template <
typename _Obj>
682 insert_or_assign(
const key_type& __k, _Obj&& __obj)
688 std::forward_as_tuple(__k),
689 std::forward_as_tuple(std::forward<_Obj>(__obj)))
693 (*__i).second = std::forward<_Obj>(__obj);
698 template <
typename _Obj>
700 insert_or_assign(
key_type&& __k, _Obj&& __obj)
706 std::forward_as_tuple(std::move(__k)),
707 std::forward_as_tuple(std::forward<_Obj>(__obj)))
711 (*__i).second = std::forward<_Obj>(__obj);
741 template <
typename _Obj>
750 std::forward_as_tuple(__k),
751 std::forward_as_tuple(
752 std::forward<_Obj>(__obj)));
754 (*__i).second = std::forward<_Obj>(__obj);
759 template <
typename _Obj>
767 std::forward_as_tuple(std::move(__k)),
768 std::forward_as_tuple(
769 std::forward<_Obj>(__obj)));
771 (*__i).second = std::forward<_Obj>(__obj);
792 {
return _M_h.erase(__position); }
797 {
return _M_h.erase(__position); }
814 {
return _M_h.erase(__x); }
832 {
return _M_h.erase(__first, __last); }
856 noexcept( noexcept(_M_h.swap(__x._M_h)) )
857 { _M_h.swap(__x._M_h); }
859 #if __cplusplus > 201402L
860 template<
typename,
typename,
typename>
861 friend class _Hash_merge_helper;
863 template<
typename _H2,
typename _P2>
867 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
868 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
871 template<
typename _H2,
typename _P2>
873 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
876 template<
typename _H2,
typename _P2>
878 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>& __source)
880 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
881 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
884 template<
typename _H2,
typename _P2>
886 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
896 {
return _M_h.hash_function(); }
902 {
return _M_h.key_eq(); }
920 {
return _M_h.find(__x); }
924 {
return _M_h.find(__x); }
938 {
return _M_h.count(__x); }
951 {
return _M_h.equal_range(__x); }
955 {
return _M_h.equal_range(__x); }
973 {
return _M_h[__k]; }
977 {
return _M_h[std::move(__k)]; }
990 {
return _M_h.at(__k); }
994 {
return _M_h.at(__k); }
1002 {
return _M_h.bucket_count(); }
1007 {
return _M_h.max_bucket_count(); }
1016 {
return _M_h.bucket_size(__n); }
1024 bucket(
const key_type& __key)
const
1025 {
return _M_h.bucket(__key); }
1035 {
return _M_h.begin(__n); }
1046 {
return _M_h.begin(__n); }
1050 {
return _M_h.cbegin(__n); }
1061 {
return _M_h.end(__n); }
1072 {
return _M_h.end(__n); }
1076 {
return _M_h.cend(__n); }
1084 {
return _M_h.load_factor(); }
1090 {
return _M_h.max_load_factor(); }
1098 { _M_h.max_load_factor(__z); }
1109 { _M_h.rehash(__n); }
1120 { _M_h.reserve(__n); }
1122 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1152 template<
class _Key,
class _Tp,
1153 class _Hash = hash<_Key>,
1156 class unordered_multimap
1158 typedef __ummap_hashtable<_Key, _Tp, _Hash, _Pred, _Alloc> _Hashtable;
1187 #if __cplusplus > 201402L
1188 using node_type =
typename _Hashtable::node_type;
1208 : _M_h(__n, __hf, __eql, __a)
1224 template<
typename _InputIterator>
1230 : _M_h(__first, __last, __n, __hf, __eql, __a)
1255 : _M_h(__ummap._M_h, __a)
1265 : _M_h(std::move(__ummap._M_h), __a)
1284 : _M_h(__l, __n, __hf, __eql, __a)
1296 template<
typename _InputIterator>
1303 template<
typename _InputIterator>
1351 {
return _M_h.get_allocator(); }
1358 {
return _M_h.empty(); }
1363 {
return _M_h.size(); }
1368 {
return _M_h.max_size(); }
1378 {
return _M_h.begin(); }
1387 {
return _M_h.begin(); }
1391 {
return _M_h.begin(); }
1400 {
return _M_h.end(); }
1409 {
return _M_h.end(); }
1413 {
return _M_h.end(); }
1433 template<
typename... _Args>
1436 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1460 template<
typename... _Args>
1463 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1477 {
return _M_h.insert(__x); }
1481 {
return _M_h.insert(std::move(__x)); }
1483 template<
typename _Pair>
1484 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1486 {
return _M_h.emplace(std::forward<_Pair>(__x)); }
1511 {
return _M_h.insert(__hint, __x); }
1517 {
return _M_h.insert(__hint, std::move(__x)); }
1519 template<
typename _Pair>
1520 __enable_if_t<is_constructible<value_type, _Pair&&>::value,
iterator>
1522 {
return _M_h.emplace_hint(__hint, std::forward<_Pair>(__x)); }
1534 template<
typename _InputIterator>
1536 insert(_InputIterator __first, _InputIterator __last)
1537 { _M_h.insert(__first, __last); }
1549 { _M_h.insert(__l); }
1551 #if __cplusplus > 201402L
1556 __glibcxx_assert(__pos !=
end());
1557 return _M_h.extract(__pos);
1563 {
return _M_h.extract(__key); }
1568 {
return _M_h._M_reinsert_node_multi(
cend(), std::move(__nh)); }
1573 {
return _M_h._M_reinsert_node_multi(__hint, std::move(__nh)); }
1592 {
return _M_h.erase(__position); }
1597 {
return _M_h.erase(__position); }
1613 {
return _M_h.erase(__x); }
1632 {
return _M_h.erase(__first, __last); }
1656 noexcept( noexcept(_M_h.swap(__x._M_h)) )
1657 { _M_h.swap(__x._M_h); }
1659 #if __cplusplus > 201402L
1660 template<
typename,
typename,
typename>
1661 friend class _Hash_merge_helper;
1663 template<
typename _H2,
typename _P2>
1668 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1669 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1672 template<
typename _H2,
typename _P2>
1674 merge(unordered_multimap<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1675 { merge(__source); }
1677 template<
typename _H2,
typename _P2>
1679 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>& __source)
1682 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1683 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1686 template<
typename _H2,
typename _P2>
1688 merge(unordered_map<_Key, _Tp, _H2, _P2, _Alloc>&& __source)
1689 { merge(__source); }
1698 {
return _M_h.hash_function(); }
1704 {
return _M_h.key_eq(); }
1722 {
return _M_h.find(__x); }
1726 {
return _M_h.find(__x); }
1736 {
return _M_h.count(__x); }
1747 {
return _M_h.equal_range(__x); }
1751 {
return _M_h.equal_range(__x); }
1759 {
return _M_h.bucket_count(); }
1764 {
return _M_h.max_bucket_count(); }
1773 {
return _M_h.bucket_size(__n); }
1781 bucket(
const key_type& __key)
const
1782 {
return _M_h.bucket(__key); }
1792 {
return _M_h.begin(__n); }
1803 {
return _M_h.begin(__n); }
1807 {
return _M_h.cbegin(__n); }
1818 {
return _M_h.end(__n); }
1829 {
return _M_h.end(__n); }
1833 {
return _M_h.cend(__n); }
1841 {
return _M_h.load_factor(); }
1847 {
return _M_h.max_load_factor(); }
1855 { _M_h.max_load_factor(__z); }
1866 { _M_h.rehash(__n); }
1877 { _M_h.reserve(__n); }
1879 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1883 _Hash1, _Pred1, _Alloc1>&,
1885 _Hash1, _Pred1, _Alloc1>&);
1888 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1890 swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
1891 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
1892 noexcept(noexcept(__x.swap(__y)))
1895 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1897 swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
1898 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
1899 noexcept(noexcept(__x.swap(__y)))
1902 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1904 operator==(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
1905 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
1906 {
return __x._M_h._M_equal(__y._M_h); }
1908 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1910 operator!=(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
1911 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
1912 {
return !(__x == __y); }
1914 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1916 operator==(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
1917 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
1918 {
return __x._M_h._M_equal(__y._M_h); }
1920 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1922 operator!=(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
1923 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
1924 {
return !(__x == __y); }
1926 _GLIBCXX_END_NAMESPACE_CONTAINER
1928 #if __cplusplus > 201402L
1929 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1931 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
1932 typename _Alloc,
typename _Hash2,
typename _Eq2>
1933 struct _Hash_merge_helper<
1934 _GLIBCXX_STD_C::unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
1938 template<
typename... _Tp>
1939 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
1940 template<
typename... _Tp>
1941 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
1943 friend unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>;
1946 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
1947 {
return __map._M_h; }
1950 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
1951 {
return __map._M_h; }
1955 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
1956 typename _Alloc,
typename _Hash2,
typename _Eq2>
1957 struct _Hash_merge_helper<
1958 _GLIBCXX_STD_C::unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>,
1962 template<
typename... _Tp>
1963 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
1964 template<
typename... _Tp>
1965 using unordered_multimap = _GLIBCXX_STD_C::unordered_multimap<_Tp...>;
1967 friend unordered_multimap<_Key, _Val, _Hash1, _Eq1, _Alloc>;
1970 _S_get_table(unordered_map<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
1971 {
return __map._M_h; }
1974 _S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
1975 {
return __map._M_h; }
1977 _GLIBCXX_END_NAMESPACE_VERSION
unordered_multimap()=default
Default constructor.
__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.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_multimap.
unordered_multimap & operator=(initializer_list< value_type > __l)
Unordered_multimap list assignment operator.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_multimap.
float load_factor() const noexcept
Returns the average number of elements per bucket.
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.
void swap(unordered_map &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_map.
_Hashtable::value_type value_type
Public typedefs.
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.
const mapped_type & at(const key_type &__k) const
Access to unordered_map data.
void reserve(size_type __n)
Prepare the unordered_map for a specified number of elements.
unordered_multimap & operator=(const unordered_multimap &)=default
Copy assignment operator.
iterator erase(const_iterator __position)
Erases an element from an unordered_multimap.
unordered_map()=default
Default constructor.
iterator emplace_hint(const_iterator __pos, _Args &&...__args)
Attempts to build and insert a std::pair into the unordered_multimap.
unordered_map & operator=(initializer_list< value_type > __l)
Unordered_map list assignment operator.
iterator emplace_hint(const_iterator __pos, _Args &&...__args)
Attempts to build and insert a std::pair into the unordered_map.
hasher hash_function() const
Returns the hash functor object with which the unordered_map was constructed.
const_iterator cend() const noexcept
Default ranged hash function H. In principle it should be a function object composed from objects of ...
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.
void swap(unordered_multimap &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_multimap.
_Hashtable::allocator_type allocator_type
Public typedefs.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
hasher hash_function() const
Returns the hash functor object with which the unordered_multimap was constructed.
Struct holding two objects of arbitrary type.
key_equal key_eq() const
Returns the key comparison object with which the unordered_multimap was constructed.
_Hashtable::key_equal key_equal
Public typedefs.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_map.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
A standard container composed of equivalent keys (possibly containing multiple of each key value) tha...
void max_load_factor(float __z)
Change the unordered_multimap maximum load factor.
Default value for rehash policy. Bucket size is (usually) the smallest prime that keeps the load fact...
mapped_type & operator[](key_type &&__k)
Subscript ( [] ) access to unordered_map data.
_Hashtable::iterator iterator
Iterator-related typedefs.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(const_iterator __hint, _Pair &&__x)
Inserts a std::pair into the unordered_multimap.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_map.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multimap.
mapped_type & at(const key_type &__k)
Access to unordered_map data.
size_type count(const key_type &__x) const
Finds the number of elements.
size_type size() const noexcept
Returns the size of the unordered_multimap.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
size_type size() const noexcept
Returns the size of the unordered_map.
_Hashtable::size_type size_type
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(iterator __position)
Erases an element from an unordered_multimap.
iterator emplace(_Args &&...__args)
Attempts to build and insert a std::pair into the unordered_multimap.
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_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_multimap.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
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::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.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
bool empty() const noexcept
Returns true if the unordered_map is empty.
iterator erase(iterator __position)
Erases an element from an unordered_map.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_map.
const_iterator begin() const noexcept
size_type erase(const key_type &__x)
Erases elements according to the provided key.
float load_factor() const noexcept
Returns the average number of elements per bucket.
void max_load_factor(float __z)
Change the unordered_map maximum load factor.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_multimap.
iterator insert(const value_type &__x)
Inserts a std::pair into the unordered_multimap.
const_iterator end() const noexcept
_GLIBCXX17_INLINE constexpr piecewise_construct_t piecewise_construct
piecewise_construct
iterator insert(const_iterator __hint, value_type &&__x)
Inserts a std::pair into the unordered_multimap.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_map.
void rehash(size_type __n)
May rehash the unordered_multimap.
float max_load_factor() const noexcept
Returns a positive number that the unordered_multimap tries to keep the load factor less than or equa...
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_map.
const_iterator cbegin() const noexcept
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
_Hashtable::pointer pointer
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.
unordered_map(const allocator_type &__a)
Creates an unordered_map with no elements.
iterator insert(value_type &&__x)
Inserts a std::pair into the unordered_multimap.
size_type max_size() const noexcept
Returns the maximum size of the unordered_map.
_Hashtable::mapped_type mapped_type
Public typedefs.
iterator begin() noexcept
_Hashtable::hasher hasher
Public typedefs.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
A standard container composed of unique keys (containing at most one of each key value) that associat...
_Hashtable::value_type value_type
Public typedefs.
One of the comparison functors.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
_Hashtable::key_equal key_equal
Public typedefs.
iterator erase(const_iterator __position)
Erases an element from an unordered_map.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
Primary class template hash.
_Hashtable::key_type key_type
Public typedefs.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_map.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
The standard allocator, as per [20.4].
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.
void reserve(size_type __n)
Prepare the unordered_multimap for a specified number of elements.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_multimap.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
unordered_multimap(const allocator_type &__a)
Creates an unordered_multimap with no elements.
__enable_if_t< is_constructible< value_type, _Pair && >::value, iterator > insert(_Pair &&__x)
Inserts a std::pair into the unordered_multimap.
std::pair< iterator, bool > emplace(_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.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
iterator insert(const_iterator __hint, value_type &&__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::size_type size_type
Iterator-related typedefs.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
Default range hashing function: use division to fold a large number into the range [0...
mapped_type & operator[](const key_type &__k)
Subscript ( [] ) access to unordered_map data.
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.
bool empty() const noexcept
Returns true if the unordered_multimap is empty.
key_equal key_eq() const
Returns the key comparison object with which the unordered_map was constructed.
_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.
__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, bool > insert(const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
const_iterator end() const noexcept
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
_Hashtable::pointer pointer
Iterator-related typedefs.
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.
const_iterator begin() const 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.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_map.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multimap.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
size_type max_size() const noexcept
Returns the maximum size of the unordered_multimap.
void rehash(size_type __n)
May rehash the unordered_map.
iterator insert(const_iterator __hint, const value_type &__x)
Inserts a std::pair into the unordered_multimap.
const_iterator cend() const noexcept
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
_Hashtable::reference reference
Iterator-related typedefs.
iterator begin() noexcept
_Hashtable::allocator_type allocator_type
Public typedefs.
const_iterator cbegin() const noexcept
_Hashtable::key_type key_type
Public typedefs.
_Hashtable::reference reference
Iterator-related typedefs.