30#ifndef _UNORDERED_SET_H
31#define _UNORDERED_SET_H
37#if __glibcxx_containers_ranges
41namespace std _GLIBCXX_VISIBILITY(default)
43_GLIBCXX_BEGIN_NAMESPACE_VERSION
44_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
50 template<
typename _Value,
55 using __uset_hashtable = _Hashtable<_Value, _Value, _Alloc,
56 __detail::_Identity, _Pred, _Hash,
57 __detail::_Mod_range_hashing,
58 __detail::_Default_ranged_hash,
59 __detail::_Prime_rehash_policy, _Tr>;
65 template<
typename _Value,
70 using __umset_hashtable = _Hashtable<_Value, _Value, _Alloc,
73 __detail::_Mod_range_hashing,
74 __detail::_Default_ranged_hash,
75 __detail::_Prime_rehash_policy, _Tr>;
77 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
103 template<
typename _Value,
109 typedef __uset_hashtable<_Value, _Hash, _Pred, _Alloc> _Hashtable;
118 typedef typename _Hashtable::hasher
hasher;
137#ifdef __glibcxx_node_extract
138 using node_type =
typename _Hashtable::node_type;
139 using insert_return_type =
typename _Hashtable::insert_return_type;
159 : _M_h(__n, __hf, __eql, __a)
175 template<
typename _InputIterator>
181 : _M_h(__first, __last, __n, __hf, __eql, __a)
205 const allocator_type& __a)
206 : _M_h(__uset._M_h, __a)
215 const allocator_type& __a)
216 noexcept(
noexcept(_Hashtable(
std::move(__uset._M_h), __a)) )
217 : _M_h(
std::
move(__uset._M_h), __a)
236 : _M_h(__l, __n, __hf, __eql, __a)
244 const allocator_type& __a)
245 : unordered_set(__n, __hf,
key_equal(), __a)
250 template<
typename _InputIterator>
256 template<
typename _InputIterator>
263 template<
typename _InputIterator>
290#if __glibcxx_containers_ranges
304 template<__detail::__container_compatible_range<_Value> _Rg>
310 : _M_h(__n, __hf, __eql, __a)
315 template<__detail::__container_compatible_range<_Value> _Rg>
320 template<__detail::__container_compatible_range<_Value> _Rg>
326 template<__detail::__container_compatible_range<_Value> _Rg>
362 {
return _M_h.get_allocator(); }
367 _GLIBCXX_NODISCARD
bool
369 {
return _M_h.empty(); }
374 {
return _M_h.size(); }
379 {
return _M_h.max_size(); }
390 {
return _M_h.begin(); }
394 {
return _M_h.begin(); }
404 {
return _M_h.end(); }
408 {
return _M_h.end(); }
417 {
return _M_h.begin(); }
425 {
return _M_h.end(); }
444 template<
typename... _Args>
470 template<
typename... _Args>
491 {
return _M_h.insert(__x); }
520 {
return _M_h.insert(__hint, __x); }
524 {
return _M_h.insert(__hint,
std::move(__x)); }
536 template<
typename _InputIterator>
538 insert(_InputIterator __first, _InputIterator __last)
539 { _M_h.insert(__first, __last); }
550 { _M_h.insert(__l); }
552#if __glibcxx_containers_ranges
559 template<__detail::__container_compatible_range<_Value> _Rg>
561 insert_range(_Rg&& __rg)
563 auto __first = ranges::begin(__rg);
564 const auto __last = ranges::end(__rg);
565 for (; __first != __last; ++__first)
566 _M_h.emplace(*__first);
570#ifdef __glibcxx_node_extract
573 extract(const_iterator __pos)
575 __glibcxx_assert(__pos !=
end());
576 return _M_h.extract(__pos);
582 {
return _M_h.extract(__key); }
584#ifdef __glibcxx_associative_heterogeneous_erasure
585 template <__heterogeneous_hash_key<unordered_set> _Kt>
588 {
return _M_h._M_extract_tr(__key); }
594 {
return _M_h._M_reinsert_node(
std::move(__nh)); }
599 {
return _M_h._M_reinsert_node(
std::move(__nh)).position; }
618 {
return _M_h.erase(__position); }
623 {
return _M_h.erase(__position); }
640 {
return _M_h.erase(__x); }
642#ifdef __glibcxx_associative_heterogeneous_erasure
643 template <__heterogeneous_hash_key<unordered_set> _Kt>
646 {
return _M_h._M_erase_tr(__key); }
665 {
return _M_h.erase(__first, __last); }
688 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
689 { _M_h.swap(__x._M_h); }
691#ifdef __glibcxx_node_extract
692 template<
typename,
typename,
typename>
693 friend class std::_Hash_merge_helper;
695 template<
typename _H2,
typename _P2>
699 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
703 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
704 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
707 template<
typename _H2,
typename _P2>
709 merge(unordered_set<_Value, _H2, _P2, _Alloc>&& __source)
711 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
712 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
715 template<
typename _H2,
typename _P2>
717 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>& __source)
719 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
720 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
723 template<
typename _H2,
typename _P2>
725 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>&& __source)
735 {
return _M_h.hash_function(); }
741 {
return _M_h.key_eq(); }
759 {
return _M_h.find(__x); }
761#ifdef __glibcxx_generic_unordered_lookup
762 template<
typename _Kt>
765 ->
decltype(_M_h._M_find_tr(__k))
766 {
return _M_h._M_find_tr(__k); }
771 {
return _M_h.find(__x); }
773#ifdef __glibcxx_generic_unordered_lookup
774 template<
typename _Kt>
776 find(
const _Kt& __k)
const
777 ->
decltype(_M_h._M_find_tr(__k))
778 {
return _M_h._M_find_tr(__k); }
794 {
return _M_h.count(__x); }
796#ifdef __glibcxx_generic_unordered_lookup
797 template<
typename _Kt>
799 count(
const _Kt& __k)
const
800 ->
decltype(_M_h._M_count_tr(__k))
801 {
return _M_h._M_count_tr(__k); }
805#if __cplusplus > 201703L
814 {
return _M_h.find(__x) != _M_h.end(); }
816 template<
typename _Kt>
819 ->
decltype(_M_h._M_find_tr(__k),
void(),
true)
820 {
return _M_h._M_find_tr(__k) != _M_h.end(); }
835 {
return _M_h.equal_range(__x); }
837#ifdef __glibcxx_generic_unordered_lookup
838 template<
typename _Kt>
841 ->
decltype(_M_h._M_equal_range_tr(__k))
842 {
return _M_h._M_equal_range_tr(__k); }
847 {
return _M_h.equal_range(__x); }
849#ifdef __glibcxx_generic_unordered_lookup
850 template<
typename _Kt>
853 ->
decltype(_M_h._M_equal_range_tr(__k))
854 {
return _M_h._M_equal_range_tr(__k); }
863 {
return _M_h.bucket_count(); }
868 {
return _M_h.max_bucket_count(); }
877 {
return _M_h.bucket_size(__n); }
886 {
return _M_h.bucket(__key); }
897 {
return _M_h.begin(__n); }
901 {
return _M_h.begin(__n); }
905 {
return _M_h.cbegin(__n); }
917 {
return _M_h.end(__n); }
921 {
return _M_h.end(__n); }
925 {
return _M_h.cend(__n); }
933 {
return _M_h.load_factor(); }
939 {
return _M_h.max_load_factor(); }
947 { _M_h.max_load_factor(__z); }
958 { _M_h.rehash(__n); }
969 { _M_h.reserve(__n); }
971 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
978#if __cpp_deduction_guides >= 201606
980 template<
typename _InputIterator,
982 hash<typename iterator_traits<_InputIterator>::value_type>,
984 equal_to<typename iterator_traits<_InputIterator>::value_type>,
985 typename _Allocator =
986 allocator<typename iterator_traits<_InputIterator>::value_type>,
987 typename = _RequireInputIter<_InputIterator>,
988 typename = _RequireNotAllocatorOrIntegral<_Hash>,
989 typename = _RequireNotAllocator<_Pred>,
990 typename = _RequireAllocator<_Allocator>>
991 unordered_set(_InputIterator, _InputIterator,
992 unordered_set<int>::size_type = {},
993 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
995 _Hash, _Pred, _Allocator>;
997 template<
typename _Tp,
typename _Hash = hash<_Tp>,
998 typename _Pred = equal_to<_Tp>,
999 typename _Allocator = allocator<_Tp>,
1000 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1001 typename = _RequireNotAllocator<_Pred>,
1002 typename = _RequireAllocator<_Allocator>>
1005 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1008 template<
typename _InputIterator,
typename _Allocator,
1009 typename = _RequireInputIter<_InputIterator>,
1010 typename = _RequireAllocator<_Allocator>>
1022 template<
typename _InputIterator,
typename _Allocator,
1023 typename = _RequireInputIter<_InputIterator>,
1024 typename = _RequireAllocator<_Allocator>>
1033 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1034 typename = _RequireInputIter<_InputIterator>,
1035 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1036 typename = _RequireAllocator<_Allocator>>
1046 template<
typename _Tp,
typename _Allocator,
1047 typename = _RequireAllocator<_Allocator>>
1054 template<
typename _Tp,
typename _Allocator,
1055 typename = _RequireAllocator<_Allocator>>
1059 template<
typename _Tp,
typename _Hash,
typename _Allocator,
1060 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1061 typename = _RequireAllocator<_Allocator>>
1066#if __glibcxx_containers_ranges
1072 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
1073 ->
unordered_set<ranges::range_value_t<_Rg>, _Hash, _Pred, _Allocator>;
1076 __allocator_like _Allocator>
1085 __allocator_like _Allocator>
1093 __not_allocator_like _Hash,
1094 __allocator_like _Allocator>
1124 template<
typename _Value,
1130 typedef __umset_hashtable<_Value, _Hash, _Pred, _Alloc> _Hashtable;
1158#ifdef __glibcxx_node_extract
1159 using node_type =
typename _Hashtable::node_type;
1179 : _M_h(__n, __hf, __eql, __a)
1195 template<
typename _InputIterator>
1201 : _M_h(__first, __last, __n, __hf, __eql, __a)
1226 : _M_h(__l, __n, __hf, __eql, __a)
1252 const allocator_type& __a)
1253 : _M_h(__umset._M_h, __a)
1262 const allocator_type& __a)
1263 noexcept(
noexcept(_Hashtable(
std::move(__umset._M_h), __a)) )
1264 : _M_h(
std::
move(__umset._M_h), __a)
1278 template<
typename _InputIterator>
1284 template<
typename _InputIterator>
1291 template<
typename _InputIterator>
1317#if __glibcxx_containers_ranges
1331 template<__detail::__container_compatible_range<_Value> _Rg>
1337 : _M_h(__n, __hf, __eql, __a)
1343 template<__detail::__container_compatible_range<_Value> _Rg>
1348 template<__detail::__container_compatible_range<_Value> _Rg>
1354 template<__detail::__container_compatible_range<_Value> _Rg>
1383 {
return _M_h.get_allocator(); }
1388 _GLIBCXX_NODISCARD
bool
1390 {
return _M_h.empty(); }
1395 {
return _M_h.size(); }
1400 {
return _M_h.max_size(); }
1411 {
return _M_h.begin(); }
1415 {
return _M_h.begin(); }
1425 {
return _M_h.end(); }
1429 {
return _M_h.end(); }
1438 {
return _M_h.begin(); }
1446 {
return _M_h.end(); }
1457 template<
typename... _Args>
1479 template<
typename... _Args>
1494 {
return _M_h.insert(__x); }
1520 {
return _M_h.insert(__hint, __x); }
1524 {
return _M_h.insert(__hint,
std::move(__x)); }
1535 template<
typename _InputIterator>
1537 insert(_InputIterator __first, _InputIterator __last)
1538 { _M_h.insert(__first, __last); }
1549 { _M_h.insert(__l); }
1551#if __glibcxx_containers_ranges
1558 template<__detail::__container_compatible_range<_Value> _Rg>
1560 insert_range(_Rg&& __rg)
1562 auto __first = ranges::begin(__rg);
1563 const auto __last = ranges::end(__rg);
1564 if (__first == __last)
1568 _M_h._M_rehash_insert(
size_type(ranges::distance(__rg)));
1570 _M_h._M_rehash_insert(1);
1572 for (; __first != __last; ++__first)
1573 _M_h.emplace(*__first);
1577#ifdef __glibcxx_node_extract
1580 extract(const_iterator __pos)
1582 __glibcxx_assert(__pos !=
end());
1583 return _M_h.extract(__pos);
1589 {
return _M_h.extract(__key); }
1591#ifdef __glibcxx_associative_heterogeneous_erasure
1592 template <__heterogeneous_hash_key<unordered_multiset> _Kt>
1594 extract(_Kt&& __key)
1595 {
return _M_h._M_extract_tr(__key); }
1601 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1606 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1626 {
return _M_h.erase(__position); }
1631 {
return _M_h.erase(__position); }
1649 {
return _M_h.erase(__x); }
1651#ifdef __glibcxx_associative_heterogeneous_erasure
1652 template <__heterogeneous_hash_key<unordered_multiset> _Kt>
1655 {
return _M_h._M_erase_tr(__key); }
1676 {
return _M_h.erase(__first, __last); }
1700 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
1701 { _M_h.swap(__x._M_h); }
1703#ifdef __glibcxx_node_extract
1704 template<
typename,
typename,
typename>
1705 friend class std::_Hash_merge_helper;
1707 template<
typename _H2,
typename _P2>
1711 if constexpr (is_same_v<_H2, _Hash> && is_same_v<_P2, _Pred>)
1716 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1717 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1720 template<
typename _H2,
typename _P2>
1722 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>&& __source)
1725 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1726 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1729 template<
typename _H2,
typename _P2>
1731 merge(unordered_set<_Value, _H2, _P2, _Alloc>& __source)
1734 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1735 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1738 template<
typename _H2,
typename _P2>
1740 merge(unordered_set<_Value, _H2, _P2, _Alloc>&& __source)
1741 { merge(__source); }
1750 {
return _M_h.hash_function(); }
1756 {
return _M_h.key_eq(); }
1774 {
return _M_h.find(__x); }
1776#ifdef __glibcxx_generic_unordered_lookup
1777 template<
typename _Kt>
1779 find(
const _Kt& __x)
1780 ->
decltype(_M_h._M_find_tr(__x))
1781 {
return _M_h._M_find_tr(__x); }
1786 {
return _M_h.find(__x); }
1788#ifdef __glibcxx_generic_unordered_lookup
1789 template<
typename _Kt>
1791 find(
const _Kt& __x)
const
1792 ->
decltype(_M_h._M_find_tr(__x))
1793 {
return _M_h._M_find_tr(__x); }
1805 {
return _M_h.count(__x); }
1807#ifdef __glibcxx_generic_unordered_lookup
1808 template<
typename _Kt>
1810 count(
const _Kt& __x)
const ->
decltype(_M_h._M_count_tr(__x))
1811 {
return _M_h._M_count_tr(__x); }
1815#if __cplusplus > 201703L
1824 {
return _M_h.find(__x) != _M_h.end(); }
1826 template<
typename _Kt>
1829 ->
decltype(_M_h._M_find_tr(__x),
void(),
true)
1830 {
return _M_h._M_find_tr(__x) != _M_h.end(); }
1843 {
return _M_h.equal_range(__x); }
1845#ifdef __glibcxx_generic_unordered_lookup
1846 template<
typename _Kt>
1849 ->
decltype(_M_h._M_equal_range_tr(__x))
1850 {
return _M_h._M_equal_range_tr(__x); }
1855 {
return _M_h.equal_range(__x); }
1857#ifdef __glibcxx_generic_unordered_lookup
1858 template<
typename _Kt>
1861 ->
decltype(_M_h._M_equal_range_tr(__x))
1862 {
return _M_h._M_equal_range_tr(__x); }
1871 {
return _M_h.bucket_count(); }
1876 {
return _M_h.max_bucket_count(); }
1885 {
return _M_h.bucket_size(__n); }
1893 bucket(
const key_type& __key)
const
1894 {
return _M_h.bucket(__key); }
1905 {
return _M_h.begin(__n); }
1909 {
return _M_h.begin(__n); }
1913 {
return _M_h.cbegin(__n); }
1925 {
return _M_h.end(__n); }
1929 {
return _M_h.end(__n); }
1933 {
return _M_h.cend(__n); }
1941 {
return _M_h.load_factor(); }
1947 {
return _M_h.max_load_factor(); }
1955 { _M_h.max_load_factor(__z); }
1966 { _M_h.rehash(__n); }
1977 { _M_h.reserve(__n); }
1979 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
1987#if __cpp_deduction_guides >= 201606
1989 template<
typename _InputIterator,
1991 hash<typename iterator_traits<_InputIterator>::value_type>,
1993 equal_to<typename iterator_traits<_InputIterator>::value_type>,
1994 typename _Allocator =
1995 allocator<typename iterator_traits<_InputIterator>::value_type>,
1996 typename = _RequireInputIter<_InputIterator>,
1997 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1998 typename = _RequireNotAllocator<_Pred>,
1999 typename = _RequireAllocator<_Allocator>>
2000 unordered_multiset(_InputIterator, _InputIterator,
2001 unordered_multiset<int>::size_type = {},
2002 _Hash = _Hash(), _Pred = _Pred(),
2003 _Allocator = _Allocator())
2005 _Hash, _Pred, _Allocator>;
2007 template<
typename _Tp,
typename _Hash = hash<_Tp>,
2008 typename _Pred = equal_to<_Tp>,
2009 typename _Allocator = allocator<_Tp>,
2010 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2011 typename = _RequireNotAllocator<_Pred>,
2012 typename = _RequireAllocator<_Allocator>>
2015 _Hash = _Hash(), _Pred = _Pred(),
2016 _Allocator = _Allocator())
2019 template<
typename _InputIterator,
typename _Allocator,
2020 typename = _RequireInputIter<_InputIterator>,
2021 typename = _RequireAllocator<_Allocator>>
2033 template<
typename _InputIterator,
typename _Allocator,
2034 typename = _RequireInputIter<_InputIterator>,
2035 typename = _RequireAllocator<_Allocator>>
2044 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
2045 typename = _RequireInputIter<_InputIterator>,
2046 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2047 typename = _RequireAllocator<_Allocator>>
2059 template<
typename _Tp,
typename _Allocator,
2060 typename = _RequireAllocator<_Allocator>>
2067 template<
typename _Tp,
typename _Allocator,
2068 typename = _RequireAllocator<_Allocator>>
2072 template<
typename _Tp,
typename _Hash,
typename _Allocator,
2073 typename = _RequireNotAllocatorOrIntegral<_Hash>,
2074 typename = _RequireAllocator<_Allocator>>
2079#if __glibcxx_containers_ranges
2086 _Hash = _Hash(), _Pred = _Pred(),
2087 _Allocator = _Allocator())
2091 __allocator_like _Allocator>
2099 __allocator_like _Allocator>
2108 __not_allocator_like _Hash,
2109 __allocator_like _Allocator>
2119 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
2123 noexcept(
noexcept(__x.swap(__y)))
2126 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
2130 noexcept(
noexcept(__x.swap(__y)))
2133 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
2137 {
return __x._M_h._M_equal(__y._M_h); }
2139#if __cpp_impl_three_way_comparison < 201907L
2140 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
2144 {
return !(__x == __y); }
2147 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
2151 {
return __x._M_h._M_equal(__y._M_h); }
2153#if __cpp_impl_three_way_comparison < 201907L
2154 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
2158 {
return !(__x == __y); }
2161_GLIBCXX_END_NAMESPACE_CONTAINER
2163#ifdef __glibcxx_node_extract
2165 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
2166 typename _Hash2,
typename _Eq2>
2167 struct _Hash_merge_helper<
2168 _GLIBCXX_STD_C::
unordered_set<_Val, _Hash1, _Eq1, _Alloc>, _Hash2, _Eq2>
2171 template<
typename... _Tp>
2172 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
2173 template<
typename... _Tp>
2174 using unordered_multiset = _GLIBCXX_STD_C::unordered_multiset<_Tp...>;
2176 friend unordered_set<_Val, _Hash1, _Eq1, _Alloc>;
2179 _S_get_table(unordered_set<_Val, _Hash2, _Eq2, _Alloc>& __set)
2180 {
return __set._M_h; }
2183 _S_get_table(unordered_multiset<_Val, _Hash2, _Eq2, _Alloc>& __set)
2184 {
return __set._M_h; }
2188 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
2189 typename _Hash2,
typename _Eq2>
2190 struct _Hash_merge_helper<
2195 template<
typename... _Tp>
2196 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
2197 template<
typename... _Tp>
2198 using unordered_multiset = _GLIBCXX_STD_C::unordered_multiset<_Tp...>;
2200 friend unordered_multiset<_Val, _Hash1, _Eq1, _Alloc>;
2203 _S_get_table(unordered_set<_Val, _Hash2, _Eq2, _Alloc>& __set)
2204 {
return __set._M_h; }
2207 _S_get_table(unordered_multiset<_Val, _Hash2, _Eq2, _Alloc>& __set)
2208 {
return __set._M_h; }
2212_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].
Traits class for iterators.
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 ...
iterator begin() noexcept
iterator insert(const_iterator __hint, const value_type &__x)
Inserts an element into the unordered_multiset.
_Hashtable::difference_type difference_type
void insert(initializer_list< value_type > __l)
Inserts a list of elements into the unordered_multiset.
_Hashtable::pointer pointer
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
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
unordered_multiset(const allocator_type &__a)
Creates an unordered_multiset with no elements.
_Hashtable::allocator_type allocator_type
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
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::size_type size_type
_Hashtable::key_type key_type
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.
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 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
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 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.
_Hashtable::hasher hasher
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
local_iterator end(size_type __n)
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
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
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
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
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
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
const_iterator cend() const noexcept
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_set.
_Hashtable::key_type key_type
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.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
const_iterator begin() const noexcept
_Hashtable::hasher hasher
_Hashtable::local_iterator local_iterator
_Hashtable::size_type size_type
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
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
size_type size() const noexcept
Returns the size of the unordered_set.
_Hashtable::const_iterator const_iterator
_Hashtable::difference_type difference_type
_Hashtable::const_reference const_reference
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.
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
iterator insert(const_iterator __hint, value_type &&__x)
Attempts to insert an element into the unordered_set.
const_iterator end() const noexcept
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.
_Hashtable::const_local_iterator const_local_iterator
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.
_Hashtable::pointer pointer
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.
[range.sized] The sized_range concept.
A range for which ranges::begin returns an input iterator.
A range for which ranges::begin returns a forward iterator.