30 #ifndef _UNORDERED_SET_H 31 #define _UNORDERED_SET_H 33 namespace std _GLIBCXX_VISIBILITY(default)
35 _GLIBCXX_BEGIN_NAMESPACE_VERSION
36 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
42 template<
typename _Value,
48 __detail::_Identity, _Pred, _Hash,
57 template<
typename _Value,
65 __detail::_Mod_range_hashing,
66 __detail::_Default_ranged_hash,
67 __detail::_Prime_rehash_policy, _Tr>;
69 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
93 template<
typename _Value,
108 typedef typename _Hashtable::hasher
hasher;
127 #if __cplusplus > 201402L 128 using node_type =
typename _Hashtable::node_type;
129 using insert_return_type =
typename _Hashtable::insert_return_type;
146 const hasher& __hf =
hasher(),
149 : _M_h(__n, __hf, __eql, __a)
165 template<
typename _InputIterator>
168 const hasher& __hf =
hasher(),
171 : _M_h(__first, __last, __n, __hf, __eql, __a)
195 const allocator_type& __a)
196 : _M_h(__uset._M_h, __a)
205 const allocator_type& __a)
206 noexcept( noexcept(_Hashtable(std::move(__uset._M_h), __a)) )
207 : _M_h(std::move(__uset._M_h), __a)
223 const hasher& __hf =
hasher(),
226 : _M_h(__l, __n, __hf, __eql, __a)
234 const allocator_type& __a)
238 template<
typename _InputIterator>
241 const allocator_type& __a)
245 template<
typename _InputIterator>
247 size_type __n,
const hasher& __hf,
248 const allocator_type& __a)
254 const allocator_type& __a)
259 size_type __n,
const hasher& __hf,
260 const allocator_type& __a)
293 {
return _M_h.get_allocator(); }
298 _GLIBCXX_NODISCARD
bool 300 {
return _M_h.empty(); }
305 {
return _M_h.size(); }
310 {
return _M_h.max_size(); }
321 {
return _M_h.begin(); }
325 {
return _M_h.begin(); }
335 {
return _M_h.end(); }
339 {
return _M_h.end(); }
348 {
return _M_h.begin(); }
356 {
return _M_h.end(); }
375 template<
typename... _Args>
378 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
401 template<
typename... _Args>
404 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
422 {
return _M_h.insert(__x); }
426 {
return _M_h.insert(std::move(__x)); }
450 insert(const_iterator __hint,
const value_type& __x)
451 {
return _M_h.insert(__hint, __x); }
454 insert(const_iterator __hint, value_type&& __x)
455 {
return _M_h.insert(__hint, std::move(__x)); }
467 template<
typename _InputIterator>
469 insert(_InputIterator __first, _InputIterator __last)
470 { _M_h.insert(__first, __last); }
481 { _M_h.insert(__l); }
483 #if __cplusplus > 201402L 486 extract(const_iterator __pos)
488 __glibcxx_assert(__pos !=
end());
489 return _M_h.extract(__pos);
494 extract(
const key_type& __key)
495 {
return _M_h.extract(__key); }
500 {
return _M_h._M_reinsert_node(std::move(__nh)); }
504 insert(const_iterator, node_type&& __nh)
505 {
return _M_h._M_reinsert_node(std::move(__nh)).position; }
524 {
return _M_h.erase(__position); }
529 {
return _M_h.erase(__position); }
546 {
return _M_h.erase(__x); }
563 erase(const_iterator __first, const_iterator __last)
564 {
return _M_h.erase(__first, __last); }
587 noexcept( noexcept(_M_h.swap(__x._M_h)) )
588 { _M_h.swap(__x._M_h); }
590 #if __cplusplus > 201402L 591 template<
typename,
typename,
typename>
592 friend class std::_Hash_merge_helper;
594 template<
typename _H2,
typename _P2>
598 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
599 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
602 template<
typename _H2,
typename _P2>
607 template<
typename _H2,
typename _P2>
611 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
612 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
615 template<
typename _H2,
typename _P2>
627 {
return _M_h.hash_function(); }
633 {
return _M_h.key_eq(); }
651 {
return _M_h.find(__x); }
654 find(
const key_type& __x)
const 655 {
return _M_h.find(__x); }
669 {
return _M_h.count(__x); }
671 #if __cplusplus > 201703L 678 contains(
const key_type& __x)
const 679 {
return _M_h.find(__x) != _M_h.end(); }
693 {
return _M_h.equal_range(__x); }
697 {
return _M_h.equal_range(__x); }
705 {
return _M_h.bucket_count(); }
710 {
return _M_h.max_bucket_count(); }
718 bucket_size(size_type __n)
const 719 {
return _M_h.bucket_size(__n); }
727 bucket(
const key_type& __key)
const 728 {
return _M_h.bucket(__key); }
739 {
return _M_h.begin(__n); }
743 {
return _M_h.begin(__n); }
747 {
return _M_h.cbegin(__n); }
759 {
return _M_h.end(__n); }
763 {
return _M_h.end(__n); }
767 {
return _M_h.cend(__n); }
775 {
return _M_h.load_factor(); }
781 {
return _M_h.max_load_factor(); }
789 { _M_h.max_load_factor(__z); }
800 { _M_h.rehash(__n); }
811 { _M_h.reserve(__n); }
813 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
820 #if __cpp_deduction_guides >= 201606 822 template<
typename _InputIterator,
827 typename _Allocator =
829 typename = _RequireInputIter<_InputIterator>,
830 typename = _RequireNotAllocatorOrIntegral<_Hash>,
831 typename = _RequireNotAllocator<_Pred>,
832 typename = _RequireAllocator<_Allocator>>
835 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
836 ->
unordered_set<
typename iterator_traits<_InputIterator>::value_type,
837 _Hash, _Pred, _Allocator>;
839 template<
typename _Tp,
typename _Hash = hash<_Tp>,
840 typename _Pred = equal_to<_Tp>,
841 typename _Allocator = allocator<_Tp>,
842 typename = _RequireNotAllocatorOrIntegral<_Hash>,
843 typename = _RequireNotAllocator<_Pred>,
844 typename = _RequireAllocator<_Allocator>>
847 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
850 template<
typename _InputIterator,
typename _Allocator,
851 typename = _RequireInputIter<_InputIterator>,
852 typename = _RequireAllocator<_Allocator>>
857 typename iterator_traits<_InputIterator>::value_type>,
859 typename iterator_traits<_InputIterator>::value_type>,
862 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
863 typename = _RequireInputIter<_InputIterator>,
864 typename = _RequireNotAllocatorOrIntegral<_Hash>,
865 typename = _RequireAllocator<_Allocator>>
872 typename iterator_traits<_InputIterator>::value_type>,
875 template<
typename _Tp,
typename _Allocator,
876 typename = _RequireAllocator<_Allocator>>
881 template<
typename _Tp,
typename _Hash,
typename _Allocator,
882 typename = _RequireNotAllocatorOrIntegral<_Hash>,
883 typename = _RequireAllocator<_Allocator>>
909 template<
typename _Value,
924 typedef typename _Hashtable::hasher
hasher;
943 #if __cplusplus > 201402L 944 using node_type =
typename _Hashtable::node_type;
961 const hasher& __hf =
hasher(),
964 : _M_h(__n, __hf, __eql, __a)
980 template<
typename _InputIterator>
983 const hasher& __hf =
hasher(),
986 : _M_h(__first, __last, __n, __hf, __eql, __a)
1008 const hasher& __hf =
hasher(),
1011 : _M_h(__l, __n, __hf, __eql, __a)
1037 const allocator_type& __a)
1038 : _M_h(__umset._M_h, __a)
1047 const allocator_type& __a)
1048 noexcept( noexcept(_Hashtable(std::move(__umset._M_h), __a)) )
1049 : _M_h(std::move(__umset._M_h), __a)
1057 const allocator_type& __a)
1061 template<
typename _InputIterator>
1064 const allocator_type& __a)
1068 template<
typename _InputIterator>
1070 size_type __n,
const hasher& __hf,
1071 const allocator_type& __a)
1077 const allocator_type& __a)
1082 size_type __n,
const hasher& __hf,
1083 const allocator_type& __a)
1108 {
return _M_h.get_allocator(); }
1113 _GLIBCXX_NODISCARD
bool 1115 {
return _M_h.empty(); }
1120 {
return _M_h.size(); }
1125 {
return _M_h.max_size(); }
1136 {
return _M_h.begin(); }
1140 {
return _M_h.begin(); }
1150 {
return _M_h.end(); }
1154 {
return _M_h.end(); }
1163 {
return _M_h.begin(); }
1171 {
return _M_h.end(); }
1182 template<
typename... _Args>
1185 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1204 template<
typename... _Args>
1207 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1219 {
return _M_h.insert(__x); }
1223 {
return _M_h.insert(std::move(__x)); }
1244 insert(const_iterator __hint,
const value_type& __x)
1245 {
return _M_h.insert(__hint, __x); }
1248 insert(const_iterator __hint, value_type&& __x)
1249 {
return _M_h.insert(__hint, std::move(__x)); }
1260 template<
typename _InputIterator>
1262 insert(_InputIterator __first, _InputIterator __last)
1263 { _M_h.insert(__first, __last); }
1274 { _M_h.insert(__l); }
1276 #if __cplusplus > 201402L 1279 extract(const_iterator __pos)
1281 __glibcxx_assert(__pos !=
end());
1282 return _M_h.extract(__pos);
1287 extract(
const key_type& __key)
1288 {
return _M_h.extract(__key); }
1293 {
return _M_h._M_reinsert_node_multi(
cend(), std::move(__nh)); }
1297 insert(const_iterator __hint, node_type&& __nh)
1298 {
return _M_h._M_reinsert_node_multi(__hint, std::move(__nh)); }
1318 {
return _M_h.erase(__position); }
1323 {
return _M_h.erase(__position); }
1341 {
return _M_h.erase(__x); }
1360 erase(const_iterator __first, const_iterator __last)
1361 {
return _M_h.erase(__first, __last); }
1385 noexcept( noexcept(_M_h.swap(__x._M_h)) )
1386 { _M_h.swap(__x._M_h); }
1388 #if __cplusplus > 201402L 1389 template<
typename,
typename,
typename>
1390 friend class std::_Hash_merge_helper;
1392 template<
typename _H2,
typename _P2>
1397 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1398 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1401 template<
typename _H2,
typename _P2>
1404 { merge(__source); }
1406 template<
typename _H2,
typename _P2>
1411 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1412 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1415 template<
typename _H2,
typename _P2>
1418 { merge(__source); }
1427 {
return _M_h.hash_function(); }
1433 {
return _M_h.key_eq(); }
1451 {
return _M_h.find(__x); }
1455 {
return _M_h.find(__x); }
1465 {
return _M_h.count(__x); }
1467 #if __cplusplus > 201703L 1474 contains(
const key_type& __x)
const 1475 {
return _M_h.find(__x) != _M_h.end(); }
1487 {
return _M_h.equal_range(__x); }
1491 {
return _M_h.equal_range(__x); }
1499 {
return _M_h.bucket_count(); }
1504 {
return _M_h.max_bucket_count(); }
1512 bucket_size(size_type __n)
const 1513 {
return _M_h.bucket_size(__n); }
1521 bucket(
const key_type& __key)
const 1522 {
return _M_h.bucket(__key); }
1533 {
return _M_h.begin(__n); }
1535 const_local_iterator
1537 {
return _M_h.begin(__n); }
1539 const_local_iterator
1541 {
return _M_h.cbegin(__n); }
1553 {
return _M_h.end(__n); }
1555 const_local_iterator
1557 {
return _M_h.end(__n); }
1559 const_local_iterator
1561 {
return _M_h.cend(__n); }
1569 {
return _M_h.load_factor(); }
1575 {
return _M_h.max_load_factor(); }
1583 { _M_h.max_load_factor(__z); }
1594 { _M_h.rehash(__n); }
1605 { _M_h.reserve(__n); }
1607 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
1615 #if __cpp_deduction_guides >= 201606 1617 template<
typename _InputIterator,
1622 typename _Allocator =
1624 typename = _RequireInputIter<_InputIterator>,
1625 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1626 typename = _RequireNotAllocator<_Pred>,
1627 typename = _RequireAllocator<_Allocator>>
1630 _Hash = _Hash(), _Pred = _Pred(),
1631 _Allocator = _Allocator())
1633 _Hash, _Pred, _Allocator>;
1635 template<
typename _Tp,
typename _Hash = hash<_Tp>,
1636 typename _Pred = equal_to<_Tp>,
1637 typename _Allocator = allocator<_Tp>,
1638 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1639 typename = _RequireNotAllocator<_Pred>,
1640 typename = _RequireAllocator<_Allocator>>
1643 _Hash = _Hash(), _Pred = _Pred(),
1644 _Allocator = _Allocator())
1647 template<
typename _InputIterator,
typename _Allocator,
1648 typename = _RequireInputIter<_InputIterator>,
1649 typename = _RequireAllocator<_Allocator>>
1654 iterator_traits<_InputIterator>::value_type>,
1656 iterator_traits<_InputIterator>::value_type>,
1659 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1660 typename = _RequireInputIter<_InputIterator>,
1661 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1662 typename = _RequireAllocator<_Allocator>>
1667 iterator_traits<_InputIterator>::value_type,
1671 iterator_traits<_InputIterator>::value_type>,
1674 template<
typename _Tp,
typename _Allocator,
1675 typename = _RequireAllocator<_Allocator>>
1680 template<
typename _Tp,
typename _Hash,
typename _Allocator,
1681 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1682 typename = _RequireAllocator<_Allocator>>
1689 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1693 noexcept(noexcept(__x.
swap(__y)))
1696 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1700 noexcept(noexcept(__x.
swap(__y)))
1703 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1707 {
return __x._M_h._M_equal(__y._M_h); }
1709 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1713 {
return !(__x == __y); }
1715 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1719 {
return __x._M_h._M_equal(__y._M_h); }
1721 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1725 {
return !(__x == __y); }
1727 _GLIBCXX_END_NAMESPACE_CONTAINER
1729 #if __cplusplus > 201402L 1731 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
1732 typename _Hash2,
typename _Eq2>
1733 struct _Hash_merge_helper<
1734 _GLIBCXX_STD_C::
unordered_set<_Val, _Hash1, _Eq1, _Alloc>, _Hash2, _Eq2>
1737 template<
typename... _Tp>
1738 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
1739 template<
typename... _Tp>
1746 {
return __set._M_h; }
1750 {
return __set._M_h; }
1754 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
1755 typename _Hash2,
typename _Eq2>
1756 struct _Hash_merge_helper<
1761 template<
typename... _Tp>
1762 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
1763 template<
typename... _Tp>
1770 {
return __set._M_h; }
1774 {
return __set._M_h; }
1778 _GLIBCXX_END_NAMESPACE_VERSION
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_set.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_set.
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
float load_factor() const noexcept
Returns the average number of elements per bucket.
void insert(initializer_list< value_type > __l)
Inserts a list of elements into the unordered_multiset.
iterator begin() noexcept
iterator begin() noexcept
_Hashtable::key_type key_type
Public typedefs.
void swap(unordered_multiset &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_multiset.
hasher hash_function() const
Returns the hash functor object with which the unordered_set was constructed.
unordered_set & operator=(initializer_list< value_type > __l)
Unordered_set list assignment operator.
iterator insert(value_type &&__x)
Inserts an element into the unordered_multiset.
_Hashtable::hasher hasher
Public typedefs.
void reserve(size_type __n)
Prepare the unordered_set for a specified number of elements.
ISO C++ entities toplevel namespace is std.
A standard container composed of equivalent keys (possibly containing multiple of each key value) in ...
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.
void rehash(size_type __n)
May rehash the unordered_set.
float max_load_factor() const noexcept
Returns a positive number that the unordered_multiset tries to keep the load factor less than or equa...
_Hashtable::size_type size_type
Iterator-related typedefs.
iterator insert(const_iterator __hint, const value_type &__x)
Inserts an element into the unordered_multiset.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
local_iterator end(size_type __n)
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_multiset.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_set.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_multiset.
const_iterator cbegin() const noexcept
iterator erase(const_iterator __position)
Erases an element from an unordered_set.
iterator insert(const_iterator __hint, value_type &&__x)
Inserts an element into the unordered_multiset.
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
const_iterator cend() const noexcept
One of the comparison functors.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
Struct holding two objects of arbitrary type.
The standard allocator, as per [20.4].
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
_Hashtable::const_reference const_reference
Iterator-related typedefs.
_Hashtable::key_equal key_equal
Public typedefs.
local_iterator begin(size_type __n)
Returns a read-only (constant) iterator pointing to the first bucket element.
key_equal key_eq() const
Returns the key comparison object with which the unordered_set was constructed.
_Hashtable::pointer pointer
Iterator-related typedefs.
unordered_multiset & operator=(initializer_list< value_type > __l)
Unordered_multiset list assignment operator.
_Hashtable::local_iterator local_iterator
Iterator-related 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.
size_type max_size() const noexcept
Returns the maximum size of the unordered_set.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert an element into the unordered_set.
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
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...
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Inserts an element into the unordered_multiset.
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.
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
_Hashtable::allocator_type allocator_type
Public typedefs.
void max_load_factor(float __z)
Change the unordered_multiset maximum load factor.
_Hashtable::allocator_type allocator_type
Public typedefs.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
const_iterator begin() const noexcept
const_local_iterator begin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
iterator erase(iterator __position)
Erases an element from an unordered_set.
iterator erase(iterator __position)
Erases an element from an 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.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
_Hashtable::reference reference
Iterator-related typedefs.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
hasher hash_function() const
Returns the hash functor object with which the unordered_multiset was constructed.
_Hashtable::difference_type difference_type
Iterator-related typedefs.
Primary class template hash.
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 insert(const value_type &__x)
Inserts an element into the unordered_multiset.
iterator insert(const_iterator __hint, value_type &&__x)
Attempts to insert an element into the unordered_set.
_Hashtable::value_type value_type
Public typedefs.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_multiset.
Default value for rehash policy. Bucket size is (usually) the smallest prime that keeps the load fact...
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multiset.
_Hashtable::local_iterator local_iterator
Iterator-related typedefs.
const_iterator end() const noexcept
_Hashtable::const_reference const_reference
Iterator-related typedefs.
iterator find(const key_type &__x)
Tries to locate an element in an unordered_set.
void swap(unordered_set &__x) noexcept(noexcept(_M_h.swap(__x._M_h)))
Swaps data with another unordered_set.
unordered_set(const allocator_type &__a)
Creates an unordered_set with no elements.
void insert(_InputIterator __first, _InputIterator __last)
A template function that attempts to insert a range of elements.
void max_load_factor(float __z)
Change the unordered_set maximum load factor.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
std::pair< iterator, bool > emplace(_Args &&... __args)
Attempts to build and insert an element into the unordered_set.
_Hashtable::key_equal key_equal
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.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to insert an element into the unordered_set.
_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.
size_type bucket_count() const noexcept
Returns the number of buckets of the unordered_set.
_Hashtable::const_iterator const_iterator
Iterator-related typedefs.
iterator emplace(_Args &&... __args)
Builds and insert an element into the unordered_multiset.
size_type size() const noexcept
Returns the size of the unordered_multiset.
size_type max_size() const noexcept
Returns the maximum size of the unordered_multiset.
_Hashtable::reference reference
Iterator-related typedefs.
size_type size() const noexcept
Returns the size of 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.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_set.
_Hashtable::const_local_iterator const_local_iterator
Iterator-related typedefs.
void insert(_InputIterator __first, _InputIterator __last)
A template function that inserts a range of elements.
local_iterator begin(size_type __n)
Returns a read-only (constant) iterator pointing to the first bucket element.
const_iterator end() const noexcept
const_local_iterator cend(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
iterator insert(const_iterator __hint, const value_type &__x)
Attempts to insert an element into the unordered_set.
_GLIBCXX_NODISCARD bool empty() const noexcept
Returns true if the unordered_multiset is empty.
_Hashtable::value_type value_type
Public typedefs.
unordered_multiset(const allocator_type &__a)
Creates an unordered_multiset with no elements.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert an element into the unordered_set.
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the unordered_set.
const_iterator cend() const noexcept
const_local_iterator end(size_type __n) const
Returns a read-only (constant) iterator pointing to one past the last bucket elements.
const_iterator find(const key_type &__x) const
Tries to locate an element in an unordered_multiset.
iterator erase(const_iterator __first, const_iterator __last)
Erases a [__first,__last) range of elements from an unordered_multiset.
unordered_set()=default
Default constructor.
void reserve(size_type __n)
Prepare the unordered_multiset for a specified number of elements.
Default ranged hash function H. In principle it should be a function object composed from objects of ...
_Hashtable::size_type size_type
Iterator-related typedefs.
const_iterator begin() const noexcept
const_local_iterator cbegin(size_type __n) const
Returns a read-only (constant) iterator pointing to the first bucket element.
_GLIBCXX_NODISCARD bool empty() const noexcept
Returns true if the unordered_set is empty.
_Hashtable::const_pointer const_pointer
Iterator-related typedefs.
_Hashtable::key_type key_type
Public typedefs.
_Hashtable::pointer pointer
Iterator-related typedefs.
void rehash(size_type __n)
May rehash the unordered_multiset.
_Hashtable::iterator iterator
Iterator-related typedefs.
unordered_set & operator=(const unordered_set &)=default
Copy assignment operator.
_Hashtable::hasher hasher
Public typedefs.
key_equal key_eq() const
Returns the key comparison object with which the unordered_multiset was constructed.
Default range hashing function: use division to fold a large number into the range [0...
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
const_iterator cbegin() const noexcept
A standard container composed of unique keys (containing at most one of each key value) in which the ...
size_type count(const key_type &__x) const
Finds the number of elements.
float load_factor() const noexcept
Returns the average number of elements per bucket.