30#ifndef _UNORDERED_SET_H
31#define _UNORDERED_SET_H
38namespace std _GLIBCXX_VISIBILITY(default)
40_GLIBCXX_BEGIN_NAMESPACE_VERSION
41_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
47 template<
typename _Value,
52 using __uset_hashtable = _Hashtable<_Value, _Value, _Alloc,
53 __detail::_Identity, _Pred, _Hash,
54 __detail::_Mod_range_hashing,
55 __detail::_Default_ranged_hash,
56 __detail::_Prime_rehash_policy, _Tr>;
62 template<
typename _Value,
67 using __umset_hashtable = _Hashtable<_Value, _Value, _Alloc,
70 __detail::_Mod_range_hashing,
71 __detail::_Default_ranged_hash,
72 __detail::_Prime_rehash_policy, _Tr>;
74 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
98 template<
typename _Value,
104 typedef __uset_hashtable<_Value, _Hash, _Pred, _Alloc> _Hashtable;
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(__uset._M_h, __a)
211 noexcept(
noexcept(_Hashtable(
std::move(__uset._M_h), __a)) )
231 : _M_h(__l, __n, __hf, __eql, __a)
243 template<
typename _InputIterator>
250 template<
typename _InputIterator>
298 {
return _M_h.get_allocator(); }
303 _GLIBCXX_NODISCARD
bool
305 {
return _M_h.empty(); }
310 {
return _M_h.size(); }
315 {
return _M_h.max_size(); }
326 {
return _M_h.begin(); }
330 {
return _M_h.begin(); }
340 {
return _M_h.end(); }
344 {
return _M_h.end(); }
353 {
return _M_h.begin(); }
361 {
return _M_h.end(); }
380 template<
typename... _Args>
383 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
406 template<
typename... _Args>
409 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
427 {
return _M_h.insert(__x); }
456 {
return _M_h.insert(__hint, __x); }
460 {
return _M_h.insert(__hint,
std::move(__x)); }
472 template<
typename _InputIterator>
474 insert(_InputIterator __first, _InputIterator __last)
475 { _M_h.insert(__first, __last); }
486 { _M_h.insert(__l); }
488#if __cplusplus > 201402L
493 __glibcxx_assert(__pos !=
end());
494 return _M_h.extract(__pos);
500 {
return _M_h.extract(__key); }
505 {
return _M_h._M_reinsert_node(
std::move(__nh)); }
510 {
return _M_h._M_reinsert_node(
std::move(__nh)).position; }
529 {
return _M_h.erase(__position); }
534 {
return _M_h.erase(__position); }
551 {
return _M_h.erase(__x); }
569 {
return _M_h.erase(__first, __last); }
592 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
593 { _M_h.swap(__x._M_h); }
595#if __cplusplus > 201402L
596 template<
typename,
typename,
typename>
597 friend class std::_Hash_merge_helper;
599 template<
typename _H2,
typename _P2>
603 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
604 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
607 template<
typename _H2,
typename _P2>
609 merge(unordered_set<_Value, _H2, _P2, _Alloc>&& __source)
612 template<
typename _H2,
typename _P2>
614 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>& __source)
616 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
617 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
620 template<
typename _H2,
typename _P2>
622 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>&& __source)
632 {
return _M_h.hash_function(); }
638 {
return _M_h.key_eq(); }
656 {
return _M_h.find(__x); }
658#if __cplusplus > 201703L
659 template<
typename _Kt>
662 ->
decltype(_M_h._M_find_tr(__k))
663 {
return _M_h._M_find_tr(__k); }
668 {
return _M_h.find(__x); }
670#if __cplusplus > 201703L
671 template<
typename _Kt>
674 ->
decltype(_M_h._M_find_tr(__k))
675 {
return _M_h._M_find_tr(__k); }
691 {
return _M_h.count(__x); }
693#if __cplusplus > 201703L
694 template<
typename _Kt>
697 ->
decltype(_M_h._M_count_tr(__k))
698 {
return _M_h._M_count_tr(__k); }
702#if __cplusplus > 201703L
711 {
return _M_h.find(__x) != _M_h.end(); }
713 template<
typename _Kt>
716 ->
decltype(_M_h._M_find_tr(__k), void(),
true)
717 {
return _M_h._M_find_tr(__k) != _M_h.end(); }
732 {
return _M_h.equal_range(__x); }
734#if __cplusplus > 201703L
735 template<
typename _Kt>
738 ->
decltype(_M_h._M_equal_range_tr(__k))
739 {
return _M_h._M_equal_range_tr(__k); }
744 {
return _M_h.equal_range(__x); }
746#if __cplusplus > 201703L
747 template<
typename _Kt>
750 ->
decltype(_M_h._M_equal_range_tr(__k))
751 {
return _M_h._M_equal_range_tr(__k); }
760 {
return _M_h.bucket_count(); }
765 {
return _M_h.max_bucket_count(); }
774 {
return _M_h.bucket_size(__n); }
783 {
return _M_h.bucket(__key); }
794 {
return _M_h.begin(__n); }
798 {
return _M_h.begin(__n); }
802 {
return _M_h.cbegin(__n); }
814 {
return _M_h.end(__n); }
818 {
return _M_h.end(__n); }
822 {
return _M_h.cend(__n); }
830 {
return _M_h.load_factor(); }
836 {
return _M_h.max_load_factor(); }
844 { _M_h.max_load_factor(__z); }
855 { _M_h.rehash(__n); }
866 { _M_h.reserve(__n); }
868 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
875#if __cpp_deduction_guides >= 201606
877 template<
typename _InputIterator,
879 hash<typename iterator_traits<_InputIterator>::value_type>,
881 equal_to<typename iterator_traits<_InputIterator>::value_type>,
882 typename _Allocator =
883 allocator<typename iterator_traits<_InputIterator>::value_type>,
884 typename = _RequireInputIter<_InputIterator>,
885 typename = _RequireNotAllocatorOrIntegral<_Hash>,
886 typename = _RequireNotAllocator<_Pred>,
887 typename = _RequireAllocator<_Allocator>>
888 unordered_set(_InputIterator, _InputIterator,
890 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
891 -> unordered_set<
typename iterator_traits<_InputIterator>::value_type,
892 _Hash, _Pred, _Allocator>;
894 template<
typename _Tp,
typename _Hash = hash<_Tp>,
895 typename _Pred = equal_to<_Tp>,
896 typename _Allocator = allocator<_Tp>,
897 typename = _RequireNotAllocatorOrIntegral<_Hash>,
898 typename = _RequireNotAllocator<_Pred>,
899 typename = _RequireAllocator<_Allocator>>
900 unordered_set(initializer_list<_Tp>,
902 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
903 -> unordered_set<_Tp, _Hash, _Pred, _Allocator>;
905 template<
typename _InputIterator,
typename _Allocator,
906 typename = _RequireInputIter<_InputIterator>,
907 typename = _RequireAllocator<_Allocator>>
908 unordered_set(_InputIterator, _InputIterator,
910 -> unordered_set<typename iterator_traits<_InputIterator>::value_type,
912 typename iterator_traits<_InputIterator>::value_type>,
914 typename iterator_traits<_InputIterator>::value_type>,
917 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
918 typename = _RequireInputIter<_InputIterator>,
919 typename = _RequireNotAllocatorOrIntegral<_Hash>,
920 typename = _RequireAllocator<_Allocator>>
921 unordered_set(_InputIterator, _InputIterator,
924 -> unordered_set<typename iterator_traits<_InputIterator>::value_type,
927 typename iterator_traits<_InputIterator>::value_type>,
930 template<
typename _Tp,
typename _Allocator,
931 typename = _RequireAllocator<_Allocator>>
932 unordered_set(initializer_list<_Tp>,
934 -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
936 template<
typename _Tp,
typename _Hash,
typename _Allocator,
937 typename = _RequireNotAllocatorOrIntegral<_Hash>,
938 typename = _RequireAllocator<_Allocator>>
939 unordered_set(initializer_list<_Tp>,
941 -> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
964 template<
typename _Value,
965 typename _Hash = hash<_Value>,
966 typename _Pred = equal_to<_Value>,
967 typename _Alloc = allocator<_Value>>
970 typedef __umset_hashtable<_Value, _Hash, _Pred, _Alloc> _Hashtable;
979 typedef typename _Hashtable::hasher
hasher;
998#if __cplusplus > 201402L
999 using node_type =
typename _Hashtable::node_type;
1019 : _M_h(__n, __hf, __eql, __a)
1035 template<
typename _InputIterator>
1041 : _M_h(__first, __last, __n, __hf, __eql, __a)
1066 : _M_h(__l, __n, __hf, __eql, __a)
1093 : _M_h(__umset._M_h, __a)
1103 noexcept(
noexcept(_Hashtable(
std::move(__umset._M_h), __a)) )
1116 template<
typename _InputIterator>
1123 template<
typename _InputIterator>
1163 {
return _M_h.get_allocator(); }
1168 _GLIBCXX_NODISCARD
bool
1170 {
return _M_h.empty(); }
1175 {
return _M_h.size(); }
1180 {
return _M_h.max_size(); }
1191 {
return _M_h.begin(); }
1195 {
return _M_h.begin(); }
1205 {
return _M_h.end(); }
1209 {
return _M_h.end(); }
1218 {
return _M_h.begin(); }
1226 {
return _M_h.end(); }
1237 template<
typename... _Args>
1240 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1259 template<
typename... _Args>
1262 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1274 {
return _M_h.insert(__x); }
1300 {
return _M_h.insert(__hint, __x); }
1304 {
return _M_h.insert(__hint,
std::move(__x)); }
1315 template<
typename _InputIterator>
1317 insert(_InputIterator __first, _InputIterator __last)
1318 { _M_h.insert(__first, __last); }
1329 { _M_h.insert(__l); }
1331#if __cplusplus > 201402L
1336 __glibcxx_assert(__pos !=
end());
1337 return _M_h.extract(__pos);
1343 {
return _M_h.extract(__key); }
1348 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1353 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1373 {
return _M_h.erase(__position); }
1378 {
return _M_h.erase(__position); }
1396 {
return _M_h.erase(__x); }
1416 {
return _M_h.erase(__first, __last); }
1440 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
1441 { _M_h.swap(__x._M_h); }
1443#if __cplusplus > 201402L
1444 template<
typename,
typename,
typename>
1445 friend class std::_Hash_merge_helper;
1447 template<
typename _H2,
typename _P2>
1452 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1453 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1456 template<
typename _H2,
typename _P2>
1458 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>&& __source)
1459 { merge(__source); }
1461 template<
typename _H2,
typename _P2>
1463 merge(unordered_set<_Value, _H2, _P2, _Alloc>& __source)
1466 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1467 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1470 template<
typename _H2,
typename _P2>
1472 merge(unordered_set<_Value, _H2, _P2, _Alloc>&& __source)
1473 { merge(__source); }
1482 {
return _M_h.hash_function(); }
1488 {
return _M_h.key_eq(); }
1506 {
return _M_h.find(__x); }
1508#if __cplusplus > 201703L
1509 template<
typename _Kt>
1512 ->
decltype(_M_h._M_find_tr(__x))
1513 {
return _M_h._M_find_tr(__x); }
1518 {
return _M_h.find(__x); }
1520#if __cplusplus > 201703L
1521 template<
typename _Kt>
1524 ->
decltype(_M_h._M_find_tr(__x))
1525 {
return _M_h._M_find_tr(__x); }
1537 {
return _M_h.count(__x); }
1539#if __cplusplus > 201703L
1540 template<
typename _Kt>
1542 count(
const _Kt& __x)
const ->
decltype(_M_h._M_count_tr(__x))
1543 {
return _M_h._M_count_tr(__x); }
1547#if __cplusplus > 201703L
1556 {
return _M_h.find(__x) != _M_h.end(); }
1558 template<
typename _Kt>
1561 ->
decltype(_M_h._M_find_tr(__x), void(),
true)
1562 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
1575 {
return _M_h.equal_range(__x); }
1577#if __cplusplus > 201703L
1578 template<
typename _Kt>
1581 ->
decltype(_M_h._M_equal_range_tr(__x))
1582 {
return _M_h._M_equal_range_tr(__x); }
1587 {
return _M_h.equal_range(__x); }
1589#if __cplusplus > 201703L
1590 template<
typename _Kt>
1593 ->
decltype(_M_h._M_equal_range_tr(__x))
1594 {
return _M_h._M_equal_range_tr(__x); }
1603 {
return _M_h.bucket_count(); }
1608 {
return _M_h.max_bucket_count(); }
1617 {
return _M_h.bucket_size(__n); }
1625 bucket(
const key_type& __key)
const
1626 {
return _M_h.bucket(__key); }
1637 {
return _M_h.begin(__n); }
1641 {
return _M_h.begin(__n); }
1645 {
return _M_h.cbegin(__n); }
1657 {
return _M_h.end(__n); }
1661 {
return _M_h.end(__n); }
1665 {
return _M_h.cend(__n); }
1673 {
return _M_h.load_factor(); }
1679 {
return _M_h.max_load_factor(); }
1687 { _M_h.max_load_factor(__z); }
1698 { _M_h.rehash(__n); }
1709 { _M_h.reserve(__n); }
1711 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
1719#if __cpp_deduction_guides >= 201606
1721 template<
typename _InputIterator,
1723 hash<typename iterator_traits<_InputIterator>::value_type>,
1725 equal_to<typename iterator_traits<_InputIterator>::value_type>,
1726 typename _Allocator =
1727 allocator<typename iterator_traits<_InputIterator>::value_type>,
1728 typename = _RequireInputIter<_InputIterator>,
1729 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1730 typename = _RequireNotAllocator<_Pred>,
1731 typename = _RequireAllocator<_Allocator>>
1732 unordered_multiset(_InputIterator, _InputIterator,
1734 _Hash = _Hash(), _Pred = _Pred(),
1735 _Allocator = _Allocator())
1736 -> unordered_multiset<
typename iterator_traits<_InputIterator>::value_type,
1737 _Hash, _Pred, _Allocator>;
1739 template<
typename _Tp,
typename _Hash = hash<_Tp>,
1740 typename _Pred = equal_to<_Tp>,
1741 typename _Allocator = allocator<_Tp>,
1742 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1743 typename = _RequireNotAllocator<_Pred>,
1744 typename = _RequireAllocator<_Allocator>>
1745 unordered_multiset(initializer_list<_Tp>,
1747 _Hash = _Hash(), _Pred = _Pred(),
1748 _Allocator = _Allocator())
1749 -> unordered_multiset<_Tp, _Hash, _Pred, _Allocator>;
1751 template<
typename _InputIterator,
typename _Allocator,
1752 typename = _RequireInputIter<_InputIterator>,
1753 typename = _RequireAllocator<_Allocator>>
1754 unordered_multiset(_InputIterator, _InputIterator,
1756 -> unordered_multiset<typename iterator_traits<_InputIterator>::value_type,
1758 iterator_traits<_InputIterator>::value_type>,
1760 iterator_traits<_InputIterator>::value_type>,
1763 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1764 typename = _RequireInputIter<_InputIterator>,
1765 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1766 typename = _RequireAllocator<_Allocator>>
1767 unordered_multiset(_InputIterator, _InputIterator,
1770 -> unordered_multiset<
typename
1771 iterator_traits<_InputIterator>::value_type,
1775 iterator_traits<_InputIterator>::value_type>,
1778 template<
typename _Tp,
typename _Allocator,
1779 typename = _RequireAllocator<_Allocator>>
1780 unordered_multiset(initializer_list<_Tp>,
1782 -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
1784 template<
typename _Tp,
typename _Hash,
typename _Allocator,
1785 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1786 typename = _RequireAllocator<_Allocator>>
1787 unordered_multiset(initializer_list<_Tp>,
1789 -> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
1793 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1795 swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
1796 unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
1797 noexcept(
noexcept(__x.swap(__y)))
1800 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1802 swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1803 unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1804 noexcept(
noexcept(__x.swap(__y)))
1807 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1809 operator==(
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
1810 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
1811 {
return __x._M_h._M_equal(__y._M_h); }
1813#if __cpp_impl_three_way_comparison < 201907L
1814 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1816 operator!=(
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
1817 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
1818 {
return !(__x == __y); }
1821 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1823 operator==(
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1824 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1825 {
return __x._M_h._M_equal(__y._M_h); }
1827#if __cpp_impl_three_way_comparison < 201907L
1828 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1830 operator!=(
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1831 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1832 {
return !(__x == __y); }
1835_GLIBCXX_END_NAMESPACE_CONTAINER
1837#if __cplusplus > 201402L
1839 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
1840 typename _Hash2,
typename _Eq2>
1841 struct _Hash_merge_helper<
1842 _GLIBCXX_STD_C::unordered_set<_Val, _Hash1, _Eq1, _Alloc>, _Hash2, _Eq2>
1845 template<
typename... _Tp>
1846 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
1847 template<
typename... _Tp>
1848 using unordered_multiset = _GLIBCXX_STD_C::unordered_multiset<_Tp...>;
1850 friend unordered_set<_Val, _Hash1, _Eq1, _Alloc>;
1853 _S_get_table(unordered_set<_Val, _Hash2, _Eq2, _Alloc>& __set)
1854 {
return __set._M_h; }
1857 _S_get_table(unordered_multiset<_Val, _Hash2, _Eq2, _Alloc>& __set)
1858 {
return __set._M_h; }
1862 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
1863 typename _Hash2,
typename _Eq2>
1864 struct _Hash_merge_helper<
1865 _GLIBCXX_STD_C::unordered_multiset<_Val, _Hash1, _Eq1, _Alloc>,
1869 template<
typename... _Tp>
1870 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
1871 template<
typename... _Tp>
1872 using unordered_multiset = _GLIBCXX_STD_C::unordered_multiset<_Tp...>;
1874 friend unordered_multiset<_Val, _Hash1, _Eq1, _Alloc>;
1877 _S_get_table(unordered_set<_Val, _Hash2, _Eq2, _Alloc>& __set)
1878 {
return __set._M_h; }
1881 _S_get_table(unordered_multiset<_Val, _Hash2, _Eq2, _Alloc>& __set)
1882 {
return __set._M_h; }
1886_GLIBCXX_END_NAMESPACE_VERSION
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.
__detail::_Hashtable_traits< _Cache, true, true > __uset_traits
Base types for unordered_set.
__detail::_Hashtable_traits< _Cache, true, false > __umset_traits
Base types for unordered_multiset.
Primary class template hash.
The standard allocator, as per C++03 [20.4.1].
One of the comparison functors.
Struct holding two objects of arbitrary type.
A standard container composed of equivalent keys (possibly containing multiple of each key value) in ...
auto find(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_multiset.
iterator begin() noexcept
auto find(const _Kt &__x) -> decltype(_M_h._M_find_tr(__x))
Tries to locate an element in an unordered_multiset.
iterator insert(const_iterator __hint, const value_type &__x)
Inserts an element into the unordered_multiset.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
void insert(initializer_list< value_type > __l)
Inserts a list of elements into the unordered_multiset.
_Hashtable::pointer pointer
Iterator-related typedefs.
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
void rehash(size_type __n)
May rehash the unordered_multiset.
local_iterator begin(size_type __n)
Returns a read-only (constant) iterator pointing to the first bucket element.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_multiset.
float max_load_factor() const noexcept
Returns a positive number that the unordered_multiset tries to keep the load factor less than or equa...
bool empty() const noexcept
Returns true if the unordered_multiset is empty.
const_iterator cend() const noexcept
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
node_type extract(const key_type &__key)
Extract a node.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
iterator emplace(_Args &&... __args)
Builds and insert an element into the unordered_multiset.
unordered_multiset(_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_multiset from a range.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
unordered_multiset(const allocator_type &__a)
Creates an unordered_multiset with no elements.
_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.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multiset.
_Hashtable::value_type value_type
Public typedefs.
unordered_multiset & operator=(unordered_multiset &&)=default
Move assignment operator.
float load_factor() const noexcept
Returns the average number of elements per bucket.
unordered_multiset()=default
Default constructor.
iterator insert(const_iterator __hint, node_type &&__nh)
Re-insert an extracted node.
_Hashtable::size_type size_type
Iterator-related typedefs.
auto equal_range(const _Kt &__x) -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
_Hashtable::key_type key_type
Public typedefs.
unordered_multiset & operator=(const unordered_multiset &)=default
Copy assignment operator.
hasher hash_function() const
Returns the hash functor object with which the unordered_multiset was constructed.
unordered_multiset(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_multiset from an initializer_list.
auto contains(const _Kt &__x) const -> decltype(_M_h._M_find_tr(__x), void(), true)
Finds whether an element with the given key exists.
auto count(const _Kt &__x) const -> decltype(_M_h._M_count_tr(__x))
Finds the number of elements.
size_type count(const key_type &__x) const
Finds the number of elements.
iterator erase(const_iterator __position)
Erases an element from an unordered_multiset.
unordered_multiset(unordered_multiset &&)=default
Move constructor.
_Hashtable::reference reference
Iterator-related typedefs.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Inserts an element into the unordered_multiset.
void swap(unordered_multiset &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_multiset.
const_iterator begin() const noexcept
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_multiset.
const_iterator cbegin() const noexcept
void insert(_InputIterator __first, _InputIterator __last)
A template function that inserts a range of elements.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
key_equal key_eq() const
Returns the key comparison object with which the unordered_multiset was constructed.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
iterator insert(value_type &&__x)
Inserts an element into the unordered_multiset.
iterator insert(const value_type &__x)
Inserts an element into the unordered_multiset.
const_iterator end() const noexcept
void reserve(size_type __n)
Prepare the unordered_multiset for a specified number of elements.
iterator insert(const_iterator __hint, value_type &&__x)
Inserts an element into the unordered_multiset.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
iterator erase(iterator __position)
Erases an element from an unordered_multiset.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multiset.
iterator insert(node_type &&__nh)
Re-insert an extracted node.
_Hashtable::hasher hasher
Public typedefs.
unordered_multiset(size_type __n, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Default constructor creates no elements.
unordered_multiset & operator=(initializer_list< value_type > __l)
Unordered_multiset list assignment operator.
size_type size() const noexcept
Returns the size of the unordered_multiset.
_Hashtable::iterator iterator
Iterator-related typedefs.
local_iterator end(size_type __n)
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
auto equal_range(const _Kt &__x) const -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
node_type extract(const_iterator __pos)
Extract a node.
size_type max_size() const noexcept
Returns the maximum size of the unordered_multiset.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
unordered_multiset(const unordered_multiset &)=default
Copy constructor.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
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_multiset.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_multiset.
_Hashtable::key_equal key_equal
Public typedefs.
void max_load_factor(float __z)
Change the unordered_multiset maximum load factor.
A standard container composed of unique keys (containing at most one of each key value) in which the ...
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert an element into the unordered_set.
_Hashtable::iterator iterator
Iterator-related typedefs.
unordered_set(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_set from an initializer_list.
void max_load_factor(float __z)
Change the unordered_set maximum load factor.
_Hashtable::reference reference
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::value_type value_type
Public typedefs.
const_iterator cend() const noexcept
auto find(const _Kt &__k) -> decltype(_M_h._M_find_tr(__k))
Tries to locate an element in an unordered_set.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_set.
_Hashtable::key_type key_type
Public typedefs.
size_type count(const key_type &__x) const
Finds the number of elements.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
auto equal_range(const _Kt &__k) -> decltype(_M_h._M_equal_range_tr(__k))
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.
auto count(const _Kt &__k) const -> decltype(_M_h._M_count_tr(__k))
Finds the number of elements.
const_iterator begin() const noexcept
_Hashtable::hasher hasher
Public typedefs.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
insert_return_type insert(node_type &&__nh)
Re-insert an extracted node.
_Hashtable::size_type size_type
Iterator-related typedefs.
const_iterator cbegin() const noexcept
bool empty() const noexcept
Returns true if the unordered_set is empty.
unordered_set & operator=(initializer_list< value_type > __l)
Unordered_set list assignment operator.
iterator erase(iterator __position)
Erases an element from an unordered_set.
unordered_set(unordered_set &&)=default
Move constructor.
unordered_set(const allocator_type &__a)
Creates an unordered_set with no elements.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
auto contains(const _Kt &__k) const -> decltype(_M_h._M_find_tr(__k), void(), true)
Finds whether an element with the given key exists.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
void swap(unordered_set &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_set.
iterator insert(const_iterator __hint, const value_type &__x)
Attempts to insert an element into the unordered_set.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert an element into the unordered_set.
float load_factor() const noexcept
Returns the average number of elements per bucket.
void rehash(size_type __n)
May rehash the unordered_set.
local_iterator end(size_type __n)
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
_Hashtable::key_equal key_equal
Public typedefs.
size_type size() const noexcept
Returns the size of the unordered_set.
iterator insert(const_iterator, node_type &&__nh)
Re-insert an extracted node.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
hasher hash_function() const
Returns the hash functor object with which the unordered_set was constructed.
unordered_set(const unordered_set &)=default
Copy constructor.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
auto find(const _Kt &__k) const -> decltype(_M_h._M_find_tr(__k))
Tries to locate an element in an unordered_set.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to insert an element into the unordered_set.
key_equal key_eq() const
Returns the key comparison object with which the unordered_set was constructed.
_Hashtable::allocator_type allocator_type
Public typedefs.
iterator insert(const_iterator __hint, value_type &&__x)
Attempts to insert an element into the unordered_set.
const_iterator end() const noexcept
node_type extract(const key_type &__key)
Extract a node.
local_iterator begin(size_type __n)
Returns a read-only (constant) iterator pointing to the first bucket element.
unordered_set()=default
Default constructor.
unordered_set & operator=(unordered_set &&)=default
Move assignment operator.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
float max_load_factor() const noexcept
Returns a positive number that the unordered_set tries to keep the load factor less than or equal to.
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
std::pair< iterator, bool > emplace(_Args &&... __args)
Attempts to build and insert an element into the unordered_set.
unordered_set & operator=(const unordered_set &)=default
Copy assignment operator.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
unordered_set(size_type __n, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Default constructor creates no elements.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_set.
iterator erase(const_iterator __position)
Erases an element from an unordered_set.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_set.
auto equal_range(const _Kt &__k) const -> decltype(_M_h._M_equal_range_tr(__k))
Finds a subsequence matching given key.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_set.
unordered_set(_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_set from a range.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_set.
void reserve(size_type __n)
Prepare the unordered_set for a specified number of elements.
node_type extract(const_iterator __pos)
Extract a node.
_Hashtable::pointer pointer
Iterator-related typedefs.
iterator begin() noexcept
iterator find(const key_type &__x)
Tries to locate an element in an unordered_set.
size_type max_size() const noexcept
Returns the maximum size of the unordered_set.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_set.