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>
100 template<
typename _Value,
106 typedef __uset_hashtable<_Value, _Hash, _Pred, _Alloc> _Hashtable;
115 typedef typename _Hashtable::hasher
hasher;
134#ifdef __glibcxx_node_extract
135 using node_type =
typename _Hashtable::node_type;
136 using insert_return_type =
typename _Hashtable::insert_return_type;
156 : _M_h(__n, __hf, __eql, __a)
172 template<
typename _InputIterator>
178 : _M_h(__first, __last, __n, __hf, __eql, __a)
202 const allocator_type& __a)
203 : _M_h(__uset._M_h, __a)
212 const allocator_type& __a)
213 noexcept(
noexcept(_Hashtable(
std::move(__uset._M_h), __a)) )
214 : _M_h(
std::
move(__uset._M_h), __a)
233 : _M_h(__l, __n, __hf, __eql, __a)
241 const allocator_type& __a)
242 : unordered_set(__n, __hf,
key_equal(), __a)
245 template<
typename _InputIterator>
248 const allocator_type& __a)
252 template<
typename _InputIterator>
254 size_type __n,
const hasher& __hf,
255 const allocator_type& __a)
256 : unordered_set(__first, __last, __n, __hf,
key_equal(), __a)
261 const allocator_type& __a)
266 size_type __n,
const hasher& __hf,
267 const allocator_type& __a)
268 : unordered_set(__l, __n, __hf,
key_equal(), __a)
300 {
return _M_h.get_allocator(); }
305 _GLIBCXX_NODISCARD
bool
307 {
return _M_h.empty(); }
312 {
return _M_h.size(); }
317 {
return _M_h.max_size(); }
328 {
return _M_h.begin(); }
332 {
return _M_h.begin(); }
342 {
return _M_h.end(); }
346 {
return _M_h.end(); }
355 {
return _M_h.begin(); }
363 {
return _M_h.end(); }
382 template<
typename... _Args>
408 template<
typename... _Args>
429 {
return _M_h.insert(__x); }
458 {
return _M_h.insert(__hint, __x); }
462 {
return _M_h.insert(__hint,
std::move(__x)); }
474 template<
typename _InputIterator>
476 insert(_InputIterator __first, _InputIterator __last)
477 { _M_h.insert(__first, __last); }
488 { _M_h.insert(__l); }
490#ifdef __glibcxx_node_extract
495 __glibcxx_assert(__pos !=
end());
496 return _M_h.extract(__pos);
502 {
return _M_h.extract(__key); }
507 {
return _M_h._M_reinsert_node(
std::move(__nh)); }
512 {
return _M_h._M_reinsert_node(
std::move(__nh)).position; }
531 {
return _M_h.erase(__position); }
536 {
return _M_h.erase(__position); }
553 {
return _M_h.erase(__x); }
571 {
return _M_h.erase(__first, __last); }
594 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
595 { _M_h.swap(__x._M_h); }
597#ifdef __glibcxx_node_extract
598 template<
typename,
typename,
typename>
599 friend class std::_Hash_merge_helper;
601 template<
typename _H2,
typename _P2>
605 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
609 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
610 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
613 template<
typename _H2,
typename _P2>
615 merge(unordered_set<_Value, _H2, _P2, _Alloc>&& __source)
617 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
618 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
621 template<
typename _H2,
typename _P2>
623 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>& __source)
625 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
626 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
629 template<
typename _H2,
typename _P2>
631 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>&& __source)
641 {
return _M_h.hash_function(); }
647 {
return _M_h.key_eq(); }
665 {
return _M_h.find(__x); }
667#if __cplusplus > 201703L
668 template<
typename _Kt>
671 ->
decltype(_M_h._M_find_tr(__k))
672 {
return _M_h._M_find_tr(__k); }
677 {
return _M_h.find(__x); }
679#if __cplusplus > 201703L
680 template<
typename _Kt>
683 ->
decltype(_M_h._M_find_tr(__k))
684 {
return _M_h._M_find_tr(__k); }
700 {
return _M_h.count(__x); }
702#if __cplusplus > 201703L
703 template<
typename _Kt>
706 ->
decltype(_M_h._M_count_tr(__k))
707 {
return _M_h._M_count_tr(__k); }
711#if __cplusplus > 201703L
720 {
return _M_h.find(__x) != _M_h.end(); }
722 template<
typename _Kt>
725 ->
decltype(_M_h._M_find_tr(__k),
void(),
true)
726 {
return _M_h._M_find_tr(__k) != _M_h.end(); }
741 {
return _M_h.equal_range(__x); }
743#if __cplusplus > 201703L
744 template<
typename _Kt>
747 ->
decltype(_M_h._M_equal_range_tr(__k))
748 {
return _M_h._M_equal_range_tr(__k); }
753 {
return _M_h.equal_range(__x); }
755#if __cplusplus > 201703L
756 template<
typename _Kt>
759 ->
decltype(_M_h._M_equal_range_tr(__k))
760 {
return _M_h._M_equal_range_tr(__k); }
769 {
return _M_h.bucket_count(); }
774 {
return _M_h.max_bucket_count(); }
782 bucket_size(size_type __n)
const
783 {
return _M_h.bucket_size(__n); }
792 {
return _M_h.bucket(__key); }
803 {
return _M_h.begin(__n); }
807 {
return _M_h.begin(__n); }
811 {
return _M_h.cbegin(__n); }
823 {
return _M_h.end(__n); }
827 {
return _M_h.end(__n); }
831 {
return _M_h.cend(__n); }
839 {
return _M_h.load_factor(); }
845 {
return _M_h.max_load_factor(); }
853 { _M_h.max_load_factor(__z); }
864 { _M_h.rehash(__n); }
875 { _M_h.reserve(__n); }
877 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
884#if __cpp_deduction_guides >= 201606
886 template<
typename _InputIterator,
888 hash<typename iterator_traits<_InputIterator>::value_type>,
890 equal_to<typename iterator_traits<_InputIterator>::value_type>,
891 typename _Allocator =
892 allocator<typename iterator_traits<_InputIterator>::value_type>,
893 typename = _RequireInputIter<_InputIterator>,
894 typename = _RequireNotAllocatorOrIntegral<_Hash>,
895 typename = _RequireNotAllocator<_Pred>,
896 typename = _RequireAllocator<_Allocator>>
897 unordered_set(_InputIterator, _InputIterator,
898 unordered_set<int>::size_type = {},
899 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
900 -> unordered_set<
typename iterator_traits<_InputIterator>::value_type,
901 _Hash, _Pred, _Allocator>;
903 template<
typename _Tp,
typename _Hash = hash<_Tp>,
904 typename _Pred = equal_to<_Tp>,
905 typename _Allocator = allocator<_Tp>,
906 typename = _RequireNotAllocatorOrIntegral<_Hash>,
907 typename = _RequireNotAllocator<_Pred>,
908 typename = _RequireAllocator<_Allocator>>
909 unordered_set(initializer_list<_Tp>,
910 unordered_set<int>::size_type = {},
911 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
912 -> unordered_set<_Tp, _Hash, _Pred, _Allocator>;
914 template<
typename _InputIterator,
typename _Allocator,
915 typename = _RequireInputIter<_InputIterator>,
916 typename = _RequireAllocator<_Allocator>>
917 unordered_set(_InputIterator, _InputIterator,
918 unordered_set<int>::size_type, _Allocator)
919 -> unordered_set<typename iterator_traits<_InputIterator>::value_type,
921 typename iterator_traits<_InputIterator>::value_type>,
923 typename iterator_traits<_InputIterator>::value_type>,
926 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
927 typename = _RequireInputIter<_InputIterator>,
928 typename = _RequireNotAllocatorOrIntegral<_Hash>,
929 typename = _RequireAllocator<_Allocator>>
930 unordered_set(_InputIterator, _InputIterator,
931 unordered_set<int>::size_type,
933 -> unordered_set<typename iterator_traits<_InputIterator>::value_type,
936 typename iterator_traits<_InputIterator>::value_type>,
939 template<
typename _Tp,
typename _Allocator,
940 typename = _RequireAllocator<_Allocator>>
941 unordered_set(initializer_list<_Tp>,
942 unordered_set<int>::size_type, _Allocator)
943 -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
945 template<
typename _Tp,
typename _Hash,
typename _Allocator,
946 typename = _RequireNotAllocatorOrIntegral<_Hash>,
947 typename = _RequireAllocator<_Allocator>>
948 unordered_set(initializer_list<_Tp>,
949 unordered_set<int>::size_type, _Hash, _Allocator)
950 -> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
975 template<
typename _Value,
976 typename _Hash = hash<_Value>,
977 typename _Pred = equal_to<_Value>,
978 typename _Alloc = allocator<_Value>>
981 typedef __umset_hashtable<_Value, _Hash, _Pred, _Alloc> _Hashtable;
990 typedef typename _Hashtable::hasher
hasher;
1009#ifdef __glibcxx_node_extract
1010 using node_type =
typename _Hashtable::node_type;
1030 : _M_h(__n, __hf, __eql, __a)
1046 template<
typename _InputIterator>
1052 : _M_h(__first, __last, __n, __hf, __eql, __a)
1077 : _M_h(__l, __n, __hf, __eql, __a)
1103 const allocator_type& __a)
1104 : _M_h(__umset._M_h, __a)
1113 const allocator_type& __a)
1114 noexcept(
noexcept(_Hashtable(
std::move(__umset._M_h), __a)) )
1115 : _M_h(
std::
move(__umset._M_h), __a)
1123 const allocator_type& __a)
1124 : unordered_multiset(__n, __hf,
key_equal(), __a)
1127 template<
typename _InputIterator>
1130 const allocator_type& __a)
1131 : unordered_multiset(__first, __last, __n,
hasher(),
key_equal(), __a)
1134 template<
typename _InputIterator>
1136 size_type __n,
const hasher& __hf,
1137 const allocator_type& __a)
1138 : unordered_multiset(__first, __last, __n, __hf,
key_equal(), __a)
1143 const allocator_type& __a)
1148 size_type __n,
const hasher& __hf,
1149 const allocator_type& __a)
1150 : unordered_multiset(__l, __n, __hf,
key_equal(), __a)
1174 {
return _M_h.get_allocator(); }
1179 _GLIBCXX_NODISCARD
bool
1181 {
return _M_h.empty(); }
1186 {
return _M_h.size(); }
1191 {
return _M_h.max_size(); }
1202 {
return _M_h.begin(); }
1206 {
return _M_h.begin(); }
1216 {
return _M_h.end(); }
1220 {
return _M_h.end(); }
1229 {
return _M_h.begin(); }
1237 {
return _M_h.end(); }
1248 template<
typename... _Args>
1270 template<
typename... _Args>
1285 {
return _M_h.insert(__x); }
1311 {
return _M_h.insert(__hint, __x); }
1315 {
return _M_h.insert(__hint,
std::move(__x)); }
1326 template<
typename _InputIterator>
1328 insert(_InputIterator __first, _InputIterator __last)
1329 { _M_h.insert(__first, __last); }
1340 { _M_h.insert(__l); }
1342#ifdef __glibcxx_node_extract
1347 __glibcxx_assert(__pos !=
end());
1348 return _M_h.extract(__pos);
1354 {
return _M_h.extract(__key); }
1359 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1364 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1384 {
return _M_h.erase(__position); }
1389 {
return _M_h.erase(__position); }
1407 {
return _M_h.erase(__x); }
1427 {
return _M_h.erase(__first, __last); }
1451 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
1452 { _M_h.swap(__x._M_h); }
1454#ifdef __glibcxx_node_extract
1455 template<
typename,
typename,
typename>
1456 friend class std::_Hash_merge_helper;
1458 template<
typename _H2,
typename _P2>
1462 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
1467 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1468 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1471 template<
typename _H2,
typename _P2>
1473 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>&& __source)
1476 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1477 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1480 template<
typename _H2,
typename _P2>
1482 merge(unordered_set<_Value, _H2, _P2, _Alloc>& __source)
1485 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1486 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1489 template<
typename _H2,
typename _P2>
1491 merge(unordered_set<_Value, _H2, _P2, _Alloc>&& __source)
1492 { merge(__source); }
1501 {
return _M_h.hash_function(); }
1507 {
return _M_h.key_eq(); }
1525 {
return _M_h.find(__x); }
1527#if __cplusplus > 201703L
1528 template<
typename _Kt>
1531 ->
decltype(_M_h._M_find_tr(__x))
1532 {
return _M_h._M_find_tr(__x); }
1537 {
return _M_h.find(__x); }
1539#if __cplusplus > 201703L
1540 template<
typename _Kt>
1543 ->
decltype(_M_h._M_find_tr(__x))
1544 {
return _M_h._M_find_tr(__x); }
1556 {
return _M_h.count(__x); }
1558#if __cplusplus > 201703L
1559 template<
typename _Kt>
1561 count(
const _Kt& __x)
const ->
decltype(_M_h._M_count_tr(__x))
1562 {
return _M_h._M_count_tr(__x); }
1566#if __cplusplus > 201703L
1575 {
return _M_h.find(__x) != _M_h.end(); }
1577 template<
typename _Kt>
1580 ->
decltype(_M_h._M_find_tr(__x),
void(),
true)
1581 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
1594 {
return _M_h.equal_range(__x); }
1596#if __cplusplus > 201703L
1597 template<
typename _Kt>
1600 ->
decltype(_M_h._M_equal_range_tr(__x))
1601 {
return _M_h._M_equal_range_tr(__x); }
1606 {
return _M_h.equal_range(__x); }
1608#if __cplusplus > 201703L
1609 template<
typename _Kt>
1612 ->
decltype(_M_h._M_equal_range_tr(__x))
1613 {
return _M_h._M_equal_range_tr(__x); }
1622 {
return _M_h.bucket_count(); }
1627 {
return _M_h.max_bucket_count(); }
1635 bucket_size(size_type __n)
const
1636 {
return _M_h.bucket_size(__n); }
1644 bucket(
const key_type& __key)
const
1645 {
return _M_h.bucket(__key); }
1656 {
return _M_h.begin(__n); }
1660 {
return _M_h.begin(__n); }
1664 {
return _M_h.cbegin(__n); }
1676 {
return _M_h.end(__n); }
1680 {
return _M_h.end(__n); }
1684 {
return _M_h.cend(__n); }
1692 {
return _M_h.load_factor(); }
1698 {
return _M_h.max_load_factor(); }
1706 { _M_h.max_load_factor(__z); }
1717 { _M_h.rehash(__n); }
1728 { _M_h.reserve(__n); }
1730 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
1738#if __cpp_deduction_guides >= 201606
1740 template<
typename _InputIterator,
1742 hash<typename iterator_traits<_InputIterator>::value_type>,
1744 equal_to<typename iterator_traits<_InputIterator>::value_type>,
1745 typename _Allocator =
1746 allocator<typename iterator_traits<_InputIterator>::value_type>,
1747 typename = _RequireInputIter<_InputIterator>,
1748 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1749 typename = _RequireNotAllocator<_Pred>,
1750 typename = _RequireAllocator<_Allocator>>
1751 unordered_multiset(_InputIterator, _InputIterator,
1752 unordered_multiset<int>::size_type = {},
1753 _Hash = _Hash(), _Pred = _Pred(),
1754 _Allocator = _Allocator())
1755 -> unordered_multiset<
typename iterator_traits<_InputIterator>::value_type,
1756 _Hash, _Pred, _Allocator>;
1758 template<
typename _Tp,
typename _Hash = hash<_Tp>,
1759 typename _Pred = equal_to<_Tp>,
1760 typename _Allocator = allocator<_Tp>,
1761 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1762 typename = _RequireNotAllocator<_Pred>,
1763 typename = _RequireAllocator<_Allocator>>
1764 unordered_multiset(initializer_list<_Tp>,
1765 unordered_multiset<int>::size_type = {},
1766 _Hash = _Hash(), _Pred = _Pred(),
1767 _Allocator = _Allocator())
1768 -> unordered_multiset<_Tp, _Hash, _Pred, _Allocator>;
1770 template<
typename _InputIterator,
typename _Allocator,
1771 typename = _RequireInputIter<_InputIterator>,
1772 typename = _RequireAllocator<_Allocator>>
1773 unordered_multiset(_InputIterator, _InputIterator,
1774 unordered_multiset<int>::size_type, _Allocator)
1775 -> unordered_multiset<typename iterator_traits<_InputIterator>::value_type,
1777 iterator_traits<_InputIterator>::value_type>,
1779 iterator_traits<_InputIterator>::value_type>,
1782 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1783 typename = _RequireInputIter<_InputIterator>,
1784 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1785 typename = _RequireAllocator<_Allocator>>
1786 unordered_multiset(_InputIterator, _InputIterator,
1787 unordered_multiset<int>::size_type,
1789 -> unordered_multiset<
typename
1790 iterator_traits<_InputIterator>::value_type,
1794 iterator_traits<_InputIterator>::value_type>,
1797 template<
typename _Tp,
typename _Allocator,
1798 typename = _RequireAllocator<_Allocator>>
1799 unordered_multiset(initializer_list<_Tp>,
1800 unordered_multiset<int>::size_type, _Allocator)
1801 -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
1803 template<
typename _Tp,
typename _Hash,
typename _Allocator,
1804 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1805 typename = _RequireAllocator<_Allocator>>
1806 unordered_multiset(initializer_list<_Tp>,
1807 unordered_multiset<int>::size_type, _Hash, _Allocator)
1808 -> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
1812 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1814 swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
1815 unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
1816 noexcept(
noexcept(__x.swap(__y)))
1819 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1821 swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1822 unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1823 noexcept(
noexcept(__x.swap(__y)))
1826 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1828 operator==(
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
1829 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
1830 {
return __x._M_h._M_equal(__y._M_h); }
1832#if __cpp_impl_three_way_comparison < 201907L
1833 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1835 operator!=(
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
1836 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
1837 {
return !(__x == __y); }
1840 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1842 operator==(
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1843 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1844 {
return __x._M_h._M_equal(__y._M_h); }
1846#if __cpp_impl_three_way_comparison < 201907L
1847 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1849 operator!=(
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1850 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1851 {
return !(__x == __y); }
1854_GLIBCXX_END_NAMESPACE_CONTAINER
1856#ifdef __glibcxx_node_extract
1858 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
1859 typename _Hash2,
typename _Eq2>
1860 struct _Hash_merge_helper<
1861 _GLIBCXX_STD_C::unordered_set<_Val, _Hash1, _Eq1, _Alloc>, _Hash2, _Eq2>
1864 template<
typename... _Tp>
1865 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
1866 template<
typename... _Tp>
1867 using unordered_multiset = _GLIBCXX_STD_C::unordered_multiset<_Tp...>;
1869 friend unordered_set<_Val, _Hash1, _Eq1, _Alloc>;
1872 _S_get_table(unordered_set<_Val, _Hash2, _Eq2, _Alloc>& __set)
1873 {
return __set._M_h; }
1876 _S_get_table(unordered_multiset<_Val, _Hash2, _Eq2, _Alloc>& __set)
1877 {
return __set._M_h; }
1881 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
1882 typename _Hash2,
typename _Eq2>
1883 struct _Hash_merge_helper<
1884 _GLIBCXX_STD_C::unordered_multiset<_Val, _Hash1, _Eq1, _Alloc>,
1888 template<
typename... _Tp>
1889 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
1890 template<
typename... _Tp>
1891 using unordered_multiset = _GLIBCXX_STD_C::unordered_multiset<_Tp...>;
1893 friend unordered_multiset<_Val, _Hash1, _Eq1, _Alloc>;
1896 _S_get_table(unordered_set<_Val, _Hash2, _Eq2, _Alloc>& __set)
1897 {
return __set._M_h; }
1900 _S_get_table(unordered_multiset<_Val, _Hash2, _Eq2, _Alloc>& __set)
1901 {
return __set._M_h; }
1905_GLIBCXX_END_NAMESPACE_VERSION
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
ISO C++ entities toplevel namespace is std.
__detail::_Hashtable_traits< _Cache, true, false > __umset_traits
Base types for unordered_multiset.
__detail::_Hashtable_traits< _Cache, true, true > __uset_traits
Base types for unordered_set.
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.
void insert(initializer_list< value_type > __l)
Inserts a list of elements into the unordered_multiset.
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.
_Hashtable::pointer pointer
Iterator-related typedefs.
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.
_Hashtable::iterator iterator
Iterator-related typedefs.
const_iterator cend() const noexcept
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.
unordered_multiset(const allocator_type &__a)
Creates an unordered_multiset 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.
_Hashtable::size_type size_type
Iterator-related typedefs.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multiset.
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.
_Hashtable::hasher hasher
Public typedefs.
iterator insert(const_iterator __hint, node_type &&__nh)
Re-insert an extracted node.
auto equal_range(const _Kt &__x) -> decltype(_M_h._M_equal_range_tr(__x))
Finds a subsequence matching given key.
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.
_Hashtable::value_type value_type
Public typedefs.
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.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
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.
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.
_Hashtable::allocator_type allocator_type
Public typedefs.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
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.
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.
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::reference reference
Iterator-related typedefs.
_Hashtable::const_iterator const_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.
_Hashtable::key_equal key_equal
Public typedefs.
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.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
unordered_multiset(const unordered_multiset &)=default
Copy constructor.
_Hashtable::key_type key_type
Public 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::const_pointer const_pointer
Iterator-related 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::const_reference const_reference
Iterator-related typedefs.
_Hashtable::allocator_type allocator_type
Public typedefs.
_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.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
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.
_Hashtable::hasher hasher
Public typedefs.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_set.
size_type count(const key_type &__x) const
Finds the number of elements.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
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.
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::const_local_iterator const_local_iterator
Iterator-related typedefs.
insert_return_type insert(node_type &&__nh)
Re-insert an extracted node.
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.
_Hashtable::pointer pointer
Iterator-related typedefs.
iterator erase(iterator __position)
Erases an element from an unordered_set.
unordered_set(unordered_set &&)=default
Move constructor.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
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.
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.
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::size_type size_type
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.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
key_equal key_eq() const
Returns the key comparison object with which the unordered_set was constructed.
iterator insert(const_iterator __hint, value_type &&__x)
Attempts to insert an element into the unordered_set.
const_iterator end() const noexcept
_Hashtable::key_equal key_equal
Public typedefs.
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.
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.
_Hashtable::key_type key_type
Public typedefs.
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.
_Hashtable::reference reference
Iterator-related typedefs.
node_type extract(const_iterator __pos)
Extract a node.
iterator begin() noexcept
iterator find(const key_type &__x)
Tries to locate an element in an unordered_set.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
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.