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,
67 __detail::_Mod_range_hashing,
68 __detail::_Default_ranged_hash,
69 __detail::_Prime_rehash_policy, _Tr>;
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;
151 const hasher& __hf =
hasher(),
154 : _M_h(__n, __hf, __eql, __a)
170 template<
typename _InputIterator>
173 const hasher& __hf =
hasher(),
176 : _M_h(__first, __last, __n, __hf, __eql, __a)
200 const allocator_type& __a)
201 : _M_h(__umap._M_h, __a)
210 const allocator_type& __a)
211 : _M_h(std::move(__umap._M_h), __a)
227 const hasher& __hf =
hasher(),
230 : _M_h(__l, __n, __hf, __eql, __a)
238 const allocator_type& __a)
242 template<
typename _InputIterator>
245 const allocator_type& __a)
249 template<
typename _InputIterator>
251 size_type __n,
const hasher& __hf,
252 const allocator_type& __a)
258 const allocator_type& __a)
263 size_type __n,
const hasher& __hf,
264 const allocator_type& __a)
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 423 extract(const_iterator __pos)
425 __glibcxx_assert(__pos !=
end());
426 return _M_h.extract(__pos);
431 extract(
const key_type& __key)
432 {
return _M_h.extract(__key); }
437 {
return _M_h._M_reinsert_node(std::move(__nh)); }
441 insert(const_iterator, node_type&& __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)
471 iterator __i =
find(__k);
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)
489 iterator __i =
find(__k);
493 std::forward_as_tuple(std::move(__k)),
494 std::forward_as_tuple(
495 std::forward<_Args>(__args)...))
530 template <
typename... _Args>
532 try_emplace(const_iterator __hint,
const key_type& __k,
535 iterator __i =
find(__k);
538 std::forward_as_tuple(__k),
539 std::forward_as_tuple(
540 std::forward<_Args>(__args)...));
545 template <
typename... _Args>
547 try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
549 iterator __i =
find(__k);
552 std::forward_as_tuple(std::move(__k)),
553 std::forward_as_tuple(
554 std::forward<_Args>(__args)...));
579 {
return _M_h.insert(__x); }
581 template<
typename _Pair,
typename =
typename 582 std::enable_if<std::is_constructible<
value_type,
583 _Pair&&>::value>::type>
586 {
return _M_h.insert(std::forward<_Pair>(__x)); }
612 insert(const_iterator __hint,
const value_type& __x)
613 {
return _M_h.insert(__hint, __x); }
615 template<
typename _Pair,
typename =
typename 616 std::enable_if<std::is_constructible<
value_type,
617 _Pair&&>::value>::type>
619 insert(const_iterator __hint, _Pair&& __x)
620 {
return _M_h.insert(__hint, std::forward<_Pair>(__x)); }
632 template<
typename _InputIterator>
634 insert(_InputIterator __first, _InputIterator __last)
635 { _M_h.insert(__first, __last); }
646 { _M_h.insert(__l); }
649 #if __cplusplus > 201402L 650 #define __cpp_lib_unordered_map_insertion 201411 671 template <
typename _Obj>
673 insert_or_assign(
const key_type& __k, _Obj&& __obj)
675 iterator __i =
find(__k);
679 std::forward_as_tuple(__k),
680 std::forward_as_tuple(std::forward<_Obj>(__obj)))
684 (*__i).second = std::forward<_Obj>(__obj);
689 template <
typename _Obj>
691 insert_or_assign(key_type&& __k, _Obj&& __obj)
693 iterator __i =
find(__k);
697 std::forward_as_tuple(std::move(__k)),
698 std::forward_as_tuple(std::forward<_Obj>(__obj)))
702 (*__i).second = std::forward<_Obj>(__obj);
732 template <
typename _Obj>
734 insert_or_assign(const_iterator __hint,
const key_type& __k,
737 iterator __i =
find(__k);
741 std::forward_as_tuple(__k),
742 std::forward_as_tuple(
743 std::forward<_Obj>(__obj)));
745 (*__i).second = std::forward<_Obj>(__obj);
750 template <
typename _Obj>
752 insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
754 iterator __i =
find(__k);
758 std::forward_as_tuple(std::move(__k)),
759 std::forward_as_tuple(
760 std::forward<_Obj>(__obj)));
762 (*__i).second = std::forward<_Obj>(__obj);
783 {
return _M_h.erase(__position); }
788 {
return _M_h.erase(__position); }
805 {
return _M_h.erase(__x); }
822 erase(const_iterator __first, const_iterator __last)
823 {
return _M_h.erase(__first, __last); }
847 noexcept( noexcept(_M_h.swap(__x._M_h)) )
848 { _M_h.swap(__x._M_h); }
850 #if __cplusplus > 201402L 851 template<
typename,
typename,
typename>
852 friend class _Hash_merge_helper;
854 template<
typename _H2,
typename _P2>
858 using _Merge_helper = _Hash_merge_helper<unordered_map, _H2, _P2>;
859 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
862 template<
typename _H2,
typename _P2>
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>
887 {
return _M_h.hash_function(); }
893 {
return _M_h.key_eq(); }
911 {
return _M_h.find(__x); }
914 find(
const key_type& __x)
const 915 {
return _M_h.find(__x); }
929 {
return _M_h.count(__x); }
942 {
return _M_h.equal_range(__x); }
946 {
return _M_h.equal_range(__x); }
964 {
return _M_h[__k]; }
968 {
return _M_h[std::move(__k)]; }
980 at(
const key_type& __k)
981 {
return _M_h.at(__k); }
984 at(
const key_type& __k)
const 985 {
return _M_h.at(__k); }
993 {
return _M_h.bucket_count(); }
998 {
return _M_h.max_bucket_count(); }
1006 bucket_size(size_type __n)
const 1007 {
return _M_h.bucket_size(__n); }
1015 bucket(
const key_type& __key)
const 1016 {
return _M_h.bucket(__key); }
1026 {
return _M_h.begin(__n); }
1035 const_local_iterator
1037 {
return _M_h.begin(__n); }
1039 const_local_iterator
1041 {
return _M_h.cbegin(__n); }
1052 {
return _M_h.end(__n); }
1061 const_local_iterator
1063 {
return _M_h.end(__n); }
1065 const_local_iterator
1067 {
return _M_h.cend(__n); }
1075 {
return _M_h.load_factor(); }
1081 {
return _M_h.max_load_factor(); }
1089 { _M_h.max_load_factor(__z); }
1100 { _M_h.rehash(__n); }
1111 { _M_h.reserve(__n); }
1113 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1143 template<
class _Key,
class _Tp,
1178 #if __cplusplus > 201402L 1179 using node_type =
typename _Hashtable::node_type;
1196 const hasher& __hf =
hasher(),
1199 : _M_h(__n, __hf, __eql, __a)
1215 template<
typename _InputIterator>
1218 const hasher& __hf =
hasher(),
1221 : _M_h(__first, __last, __n, __hf, __eql, __a)
1245 const allocator_type& __a)
1246 : _M_h(__ummap._M_h, __a)
1255 const allocator_type& __a)
1256 : _M_h(std::move(__ummap._M_h), __a)
1272 const hasher& __hf =
hasher(),
1275 : _M_h(__l, __n, __hf, __eql, __a)
1283 const allocator_type& __a)
1287 template<
typename _InputIterator>
1290 const allocator_type& __a)
1294 template<
typename _InputIterator>
1296 size_type __n,
const hasher& __hf,
1297 const allocator_type& __a)
1303 const allocator_type& __a)
1308 size_type __n,
const hasher& __hf,
1309 const allocator_type& __a)
1342 {
return _M_h.get_allocator(); }
1349 {
return _M_h.empty(); }
1354 {
return _M_h.size(); }
1359 {
return _M_h.max_size(); }
1369 {
return _M_h.begin(); }
1378 {
return _M_h.begin(); }
1382 {
return _M_h.begin(); }
1391 {
return _M_h.end(); }
1400 {
return _M_h.end(); }
1404 {
return _M_h.end(); }
1424 template<
typename... _Args>
1427 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1451 template<
typename... _Args>
1454 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1468 {
return _M_h.insert(__x); }
1470 template<
typename _Pair,
typename =
typename 1471 std::enable_if<std::is_constructible<
value_type,
1472 _Pair&&>::value>::type>
1475 {
return _M_h.insert(std::forward<_Pair>(__x)); }
1499 insert(const_iterator __hint,
const value_type& __x)
1500 {
return _M_h.insert(__hint, __x); }
1502 template<
typename _Pair,
typename =
typename 1503 std::enable_if<std::is_constructible<
value_type,
1504 _Pair&&>::value>::type>
1507 {
return _M_h.insert(__hint, std::forward<_Pair>(__x)); }
1519 template<
typename _InputIterator>
1521 insert(_InputIterator __first, _InputIterator __last)
1522 { _M_h.insert(__first, __last); }
1534 { _M_h.insert(__l); }
1536 #if __cplusplus > 201402L 1539 extract(const_iterator __pos)
1541 __glibcxx_assert(__pos !=
end());
1542 return _M_h.extract(__pos);
1547 extract(
const key_type& __key)
1548 {
return _M_h.extract(__key); }
1553 {
return _M_h._M_reinsert_node_multi(
cend(), std::move(__nh)); }
1557 insert(const_iterator __hint, node_type&& __nh)
1558 {
return _M_h._M_reinsert_node_multi(__hint, std::move(__nh)); }
1577 {
return _M_h.erase(__position); }
1582 {
return _M_h.erase(__position); }
1598 {
return _M_h.erase(__x); }
1616 erase(const_iterator __first, const_iterator __last)
1617 {
return _M_h.erase(__first, __last); }
1641 noexcept( noexcept(_M_h.swap(__x._M_h)) )
1642 { _M_h.swap(__x._M_h); }
1644 #if __cplusplus > 201402L 1645 template<
typename,
typename,
typename>
1646 friend class _Hash_merge_helper;
1648 template<
typename _H2,
typename _P2>
1653 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1654 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1657 template<
typename _H2,
typename _P2>
1660 { merge(__source); }
1662 template<
typename _H2,
typename _P2>
1667 = _Hash_merge_helper<unordered_multimap, _H2, _P2>;
1668 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1671 template<
typename _H2,
typename _P2>
1674 { merge(__source); }
1683 {
return _M_h.hash_function(); }
1689 {
return _M_h.key_eq(); }
1707 {
return _M_h.find(__x); }
1711 {
return _M_h.find(__x); }
1721 {
return _M_h.count(__x); }
1732 {
return _M_h.equal_range(__x); }
1736 {
return _M_h.equal_range(__x); }
1744 {
return _M_h.bucket_count(); }
1749 {
return _M_h.max_bucket_count(); }
1757 bucket_size(size_type __n)
const 1758 {
return _M_h.bucket_size(__n); }
1766 bucket(
const key_type& __key)
const 1767 {
return _M_h.bucket(__key); }
1777 {
return _M_h.begin(__n); }
1786 const_local_iterator
1788 {
return _M_h.begin(__n); }
1790 const_local_iterator
1792 {
return _M_h.cbegin(__n); }
1803 {
return _M_h.end(__n); }
1812 const_local_iterator
1814 {
return _M_h.end(__n); }
1816 const_local_iterator
1818 {
return _M_h.cend(__n); }
1826 {
return _M_h.load_factor(); }
1832 {
return _M_h.max_load_factor(); }
1840 { _M_h.max_load_factor(__z); }
1851 { _M_h.rehash(__n); }
1862 { _M_h.reserve(__n); }
1864 template<
typename _Key1,
typename _Tp1,
typename _Hash1,
typename _Pred1,
1868 _Hash1, _Pred1, _Alloc1>&,
1870 _Hash1, _Pred1, _Alloc1>&);
1873 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1877 noexcept(noexcept(__x.
swap(__y)))
1880 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1884 noexcept(noexcept(__x.
swap(__y)))
1887 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1891 {
return __x._M_h._M_equal(__y._M_h); }
1893 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1897 {
return !(__x == __y); }
1899 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1903 {
return __x._M_h._M_equal(__y._M_h); }
1905 template<
class _Key,
class _Tp,
class _Hash,
class _Pred,
class _Alloc>
1909 {
return !(__x == __y); }
1911 _GLIBCXX_END_NAMESPACE_CONTAINER
1913 #if __cplusplus > 201402L 1914 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1916 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
1917 typename _Alloc,
typename _Hash2,
typename _Eq2>
1918 struct _Hash_merge_helper<
1919 _GLIBCXX_STD_C::
unordered_map<_Key, _Val, _Hash1, _Eq1, _Alloc>,
1923 template<
typename... _Tp>
1924 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
1925 template<
typename... _Tp>
1932 {
return __map._M_h; }
1936 {
return __map._M_h; }
1940 template<
typename _Key,
typename _Val,
typename _Hash1,
typename _Eq1,
1941 typename _Alloc,
typename _Hash2,
typename _Eq2>
1942 struct _Hash_merge_helper<
1947 template<
typename... _Tp>
1948 using unordered_map = _GLIBCXX_STD_C::unordered_map<_Tp...>;
1949 template<
typename... _Tp>
1956 {
return __map._M_h; }
1960 {
return __map._M_h; }
1962 _GLIBCXX_END_NAMESPACE_VERSION
One of the comparison functors.
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::mapped_type mapped_type
Public typedefs.
_Hashtable::key_equal key_equal
Public typedefs.
size_type size() const noexcept
Returns the size of the unordered_map.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_map.
const_iterator begin() const noexcept
void max_load_factor(float __z)
Change the unordered_multimap maximum load factor.
mapped_type & operator[](key_type &&__k)
Subscript ( [] ) access to unordered_map data.
_Hashtable::iterator iterator
Iterator-related typedefs.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
_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.
size_type max_size() const noexcept
Returns the maximum size of the unordered_multimap.
mapped_type & at(const key_type &__k)
Access to unordered_map data.
The standard allocator, as per [20.4].
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.
iterator erase(iterator __position)
Erases an element 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...
size_type max_size() const noexcept
Returns the maximum size of the unordered_map.
Default ranged hash function H. In principle it should be a function object composed from objects of ...
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_multimap.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_map.
float load_factor() const noexcept
Returns the average number of elements per bucket.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
_Hashtable::reference reference
Iterator-related typedefs.
iterator begin() noexcept
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_multimap.
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.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_map.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_multimap.
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.
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.
iterator insert(const_iterator __hint, _Pair &&__x)
Inserts a std::pair into the unordered_multimap.
iterator insert(const_iterator __hint, _Pair &&__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::value_type value_type
Public typedefs.
void reserve(size_type __n)
Prepare the unordered_map for a specified number of elements.
_GLIBCXX17_INLINE constexpr piecewise_construct_t piecewise_construct
piecewise_construct
iterator erase(const_iterator __position)
Erases an element from an unordered_multimap.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_map.
const_iterator end() const noexcept
const_iterator begin() const noexcept
unordered_map & operator=(initializer_list< value_type > __l)
Unordered_map list assignment operator.
bool empty() const noexcept
Returns true if the unordered_map is empty.
iterator emplace_hint(const_iterator __pos, _Args &&...__args)
Attempts to build and insert a std::pair into the unordered_map.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multimap.
hasher hash_function() const
Returns the hash functor object with which the unordered_map was constructed.
const_iterator cend() const noexcept
void swap(unordered_multimap &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_multimap.
_Hashtable::mapped_type mapped_type
Public typedefs.
iterator begin() noexcept
_Hashtable::hasher hasher
Public typedefs.
key_equal key_eq() const
Returns the key comparison object with which the unordered_multimap was constructed.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
_Hashtable::value_type value_type
Public typedefs.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
_Hashtable::key_equal key_equal
Public typedefs.
const_iterator cbegin() const noexcept
iterator erase(const_iterator __position)
Erases an element from an unordered_map.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_multimap.
ISO C++ entities toplevel namespace is std.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multimap.
size_type count(const key_type &__x) const
Finds the number of elements.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_map.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
_Hashtable::size_type size_type
Iterator-related typedefs.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
iterator emplace(_Args &&...__args)
Attempts to build and insert a std::pair into the unordered_multimap.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_map.
void reserve(size_type __n)
Prepare the unordered_multimap for a specified number of elements.
iterator insert(const_iterator __hint, const value_type &__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
_Hashtable::iterator iterator
Iterator-related typedefs.
_Hashtable::hasher hasher
Public typedefs.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
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.
unordered_multimap(const allocator_type &__a)
Creates an unordered_multimap with no elements.
const_local_iterator end(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.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
void max_load_factor(float __z)
Change the unordered_map maximum load factor.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
iterator insert(const value_type &__x)
Inserts a std::pair into the unordered_multimap.
std::pair< iterator, bool > insert(_Pair &&__x)
Attempts to insert a std::pair into the unordered_map.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
Struct holding two objects of arbitrary type.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
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.
size_type count(const key_type &__x) const
Finds the number of elements.
void rehash(size_type __n)
May rehash the unordered_multimap.
A standard container composed of equivalent keys (possibly containing multiple of each key value) tha...
key_equal key_eq() const
Returns the key comparison object with which the unordered_map was constructed.
Default value for rehash policy. Bucket size is (usually) the smallest prime that keeps the load fact...
local_iterator end(size_type __n)
Returns a read/write iterator pointing to one past the last bucket elements.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
bool empty() const noexcept
Returns true if the unordered_multimap is empty.
_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(_Pair &&__x)
Inserts a std::pair into the unordered_multimap.
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.
const_iterator end() const noexcept
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
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.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
Default range hashing function: use division to fold a large number into the range [0...
const_iterator cend() const noexcept
_Hashtable::allocator_type allocator_type
Public typedefs.
_Hashtable::key_type key_type
Public typedefs.
_Hashtable::key_type key_type
Public typedefs.
_Hashtable::reference reference
Iterator-related typedefs.
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.
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.
size_type size() const noexcept
Returns the size of the unordered_multimap.
unordered_map & operator=(const unordered_map &)=default
Copy assignment operator.
Primary class template hash.
const mapped_type & at(const key_type &__k) const
Access to unordered_map data.
local_iterator begin(size_type __n)
Returns a read/write iterator pointing to the first bucket element.
std::pair< iterator, bool > emplace(_Args &&...__args)
Attempts to build and insert a std::pair into the unordered_map.
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.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
_Hashtable::size_type size_type
Iterator-related typedefs.
const_iterator cbegin() const noexcept
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.
_Hashtable::allocator_type allocator_type
Public typedefs.
mapped_type & operator[](const key_type &__k)
Subscript ( [] ) access to unordered_map data.
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.
A standard container composed of unique keys (containing at most one of each key value) that associat...