30#ifndef _UNORDERED_SET_H
31#define _UNORDERED_SET_H
33namespace 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,
69 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
93 template<
typename _Value,
107 typedef typename _Hashtable::value_type value_type;
108 typedef typename _Hashtable::hasher hasher;
109 typedef typename _Hashtable::key_equal key_equal;
110 typedef typename _Hashtable::allocator_type allocator_type;
116 typedef typename _Hashtable::const_pointer const_pointer;
117 typedef typename _Hashtable::reference reference;
118 typedef typename _Hashtable::const_reference const_reference;
119 typedef typename _Hashtable::iterator iterator;
120 typedef typename _Hashtable::const_iterator const_iterator;
121 typedef typename _Hashtable::local_iterator local_iterator;
122 typedef typename _Hashtable::const_local_iterator const_local_iterator;
123 typedef typename _Hashtable::size_type size_type;
124 typedef typename _Hashtable::difference_type difference_type;
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(),
147 const key_equal& __eql = key_equal(),
148 const allocator_type& __a = allocator_type())
149 : _M_h(__n, __hf, __eql, __a)
165 template<
typename _InputIterator>
168 const hasher& __hf = hasher(),
169 const key_equal& __eql = key_equal(),
170 const allocator_type& __a = allocator_type())
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 : _M_h(
std::
move(__uset._M_h), __a)
222 const hasher& __hf = hasher(),
223 const key_equal& __eql = key_equal(),
224 const allocator_type& __a = allocator_type())
225 : _M_h(__l, __n, __hf, __eql, __a)
233 const allocator_type& __a)
237 template<
typename _InputIterator>
240 const allocator_type& __a)
241 :
unordered_set(__first, __last, __n, hasher(), key_equal(), __a)
244 template<
typename _InputIterator>
246 size_type __n,
const hasher& __hf,
247 const allocator_type& __a)
248 :
unordered_set(__first, __last, __n, __hf, key_equal(), __a)
253 const allocator_type& __a)
258 size_type __n,
const hasher& __hf,
259 const allocator_type& __a)
292 {
return _M_h.get_allocator(); }
297 _GLIBCXX_NODISCARD
bool
299 {
return _M_h.empty(); }
304 {
return _M_h.size(); }
309 {
return _M_h.max_size(); }
320 {
return _M_h.begin(); }
323 begin() const noexcept
324 {
return _M_h.begin(); }
334 {
return _M_h.end(); }
338 {
return _M_h.end(); }
347 {
return _M_h.begin(); }
355 {
return _M_h.end(); }
374 template<
typename... _Args>
377 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
400 template<
typename... _Args>
403 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
421 {
return _M_h.insert(__x); }
449 insert(const_iterator __hint,
const value_type& __x)
450 {
return _M_h.insert(__hint, __x); }
453 insert(const_iterator __hint, value_type&& __x)
454 {
return _M_h.insert(__hint,
std::move(__x)); }
466 template<
typename _InputIterator>
468 insert(_InputIterator __first, _InputIterator __last)
469 { _M_h.insert(__first, __last); }
480 { _M_h.insert(__l); }
482#if __cplusplus > 201402L
485 extract(const_iterator __pos)
487 __glibcxx_assert(__pos !=
end());
488 return _M_h.extract(__pos);
494 {
return _M_h.extract(__key); }
499 {
return _M_h._M_reinsert_node(
std::move(__nh)); }
503 insert(const_iterator, node_type&& __nh)
504 {
return _M_h._M_reinsert_node(
std::move(__nh)).position; }
523 {
return _M_h.erase(__position); }
528 {
return _M_h.erase(__position); }
545 {
return _M_h.erase(__x); }
562 erase(const_iterator __first, const_iterator __last)
563 {
return _M_h.erase(__first, __last); }
586 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
587 { _M_h.swap(__x._M_h); }
589#if __cplusplus > 201402L
590 template<
typename,
typename,
typename>
591 friend class std::_Hash_merge_helper;
593 template<
typename _H2,
typename _P2>
597 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
598 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
601 template<
typename _H2,
typename _P2>
603 merge(unordered_set<_Value, _H2, _P2, _Alloc>&& __source)
606 template<
typename _H2,
typename _P2>
608 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>& __source)
610 using _Merge_helper = _Hash_merge_helper<unordered_set, _H2, _P2>;
611 _M_h._M_merge_unique(_Merge_helper::_S_get_table(__source));
614 template<
typename _H2,
typename _P2>
616 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>&& __source)
626 {
return _M_h.hash_function(); }
632 {
return _M_h.key_eq(); }
650 {
return _M_h.find(__x); }
654 {
return _M_h.find(__x); }
668 {
return _M_h.count(__x); }
670#if __cplusplus > 201703L
678 {
return _M_h.find(__x) != _M_h.end(); }
692 {
return _M_h.equal_range(__x); }
696 {
return _M_h.equal_range(__x); }
704 {
return _M_h.bucket_count(); }
709 {
return _M_h.max_bucket_count(); }
717 bucket_size(size_type __n)
const
718 {
return _M_h.bucket_size(__n); }
727 {
return _M_h.bucket(__key); }
738 {
return _M_h.begin(__n); }
741 begin(size_type __n)
const
742 {
return _M_h.begin(__n); }
745 cbegin(size_type __n)
const
746 {
return _M_h.cbegin(__n); }
758 {
return _M_h.end(__n); }
761 end(size_type __n)
const
762 {
return _M_h.end(__n); }
765 cend(size_type __n)
const
766 {
return _M_h.cend(__n); }
774 {
return _M_h.load_factor(); }
780 {
return _M_h.max_load_factor(); }
788 { _M_h.max_load_factor(__z); }
799 { _M_h.rehash(__n); }
810 { _M_h.reserve(__n); }
812 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
819#if __cpp_deduction_guides >= 201606
821 template<
typename _InputIterator,
823 hash<typename iterator_traits<_InputIterator>::value_type>,
825 equal_to<typename iterator_traits<_InputIterator>::value_type>,
826 typename _Allocator =
827 allocator<typename iterator_traits<_InputIterator>::value_type>,
828 typename = _RequireInputIter<_InputIterator>,
829 typename = _RequireNotAllocatorOrIntegral<_Hash>,
830 typename = _RequireNotAllocator<_Pred>,
831 typename = _RequireAllocator<_Allocator>>
832 unordered_set(_InputIterator, _InputIterator,
833 unordered_set<int>::size_type = {},
834 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
835 -> unordered_set<
typename iterator_traits<_InputIterator>::value_type,
836 _Hash, _Pred, _Allocator>;
838 template<
typename _Tp,
typename _Hash = hash<_Tp>,
839 typename _Pred = equal_to<_Tp>,
840 typename _Allocator = allocator<_Tp>,
841 typename = _RequireNotAllocatorOrIntegral<_Hash>,
842 typename = _RequireNotAllocator<_Pred>,
843 typename = _RequireAllocator<_Allocator>>
844 unordered_set(initializer_list<_Tp>,
845 unordered_set<int>::size_type = {},
846 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
847 -> unordered_set<_Tp, _Hash, _Pred, _Allocator>;
849 template<
typename _InputIterator,
typename _Allocator,
850 typename = _RequireInputIter<_InputIterator>,
851 typename = _RequireAllocator<_Allocator>>
852 unordered_set(_InputIterator, _InputIterator,
853 unordered_set<int>::size_type, _Allocator)
854 -> unordered_set<typename iterator_traits<_InputIterator>::value_type,
856 typename iterator_traits<_InputIterator>::value_type>,
858 typename iterator_traits<_InputIterator>::value_type>,
861 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
862 typename = _RequireInputIter<_InputIterator>,
863 typename = _RequireNotAllocatorOrIntegral<_Hash>,
864 typename = _RequireAllocator<_Allocator>>
865 unordered_set(_InputIterator, _InputIterator,
866 unordered_set<int>::size_type,
868 -> unordered_set<typename iterator_traits<_InputIterator>::value_type,
871 typename iterator_traits<_InputIterator>::value_type>,
874 template<
typename _Tp,
typename _Allocator,
875 typename = _RequireAllocator<_Allocator>>
876 unordered_set(initializer_list<_Tp>,
877 unordered_set<int>::size_type, _Allocator)
878 -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
880 template<
typename _Tp,
typename _Hash,
typename _Allocator,
881 typename = _RequireNotAllocatorOrIntegral<_Hash>,
882 typename = _RequireAllocator<_Allocator>>
883 unordered_set(initializer_list<_Tp>,
884 unordered_set<int>::size_type, _Hash, _Allocator)
885 -> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
908 template<
typename _Value,
909 typename _Hash = hash<_Value>,
910 typename _Pred = equal_to<_Value>,
911 typename _Alloc = allocator<_Value>>
922 typedef typename _Hashtable::value_type value_type;
923 typedef typename _Hashtable::hasher hasher;
924 typedef typename _Hashtable::key_equal key_equal;
925 typedef typename _Hashtable::allocator_type allocator_type;
931 typedef typename _Hashtable::const_pointer const_pointer;
932 typedef typename _Hashtable::reference reference;
933 typedef typename _Hashtable::const_reference const_reference;
934 typedef typename _Hashtable::iterator iterator;
935 typedef typename _Hashtable::const_iterator const_iterator;
936 typedef typename _Hashtable::local_iterator local_iterator;
937 typedef typename _Hashtable::const_local_iterator const_local_iterator;
938 typedef typename _Hashtable::size_type size_type;
939 typedef typename _Hashtable::difference_type difference_type;
942#if __cplusplus > 201402L
943 using node_type =
typename _Hashtable::node_type;
960 const hasher& __hf = hasher(),
961 const key_equal& __eql = key_equal(),
962 const allocator_type& __a = allocator_type())
963 : _M_h(__n, __hf, __eql, __a)
979 template<
typename _InputIterator>
982 const hasher& __hf = hasher(),
983 const key_equal& __eql = key_equal(),
984 const allocator_type& __a = allocator_type())
985 : _M_h(__first, __last, __n, __hf, __eql, __a)
1007 const hasher& __hf = hasher(),
1008 const key_equal& __eql = key_equal(),
1009 const allocator_type& __a = allocator_type())
1010 : _M_h(__l, __n, __hf, __eql, __a)
1036 const allocator_type& __a)
1037 : _M_h(__umset._M_h, __a)
1046 const allocator_type& __a)
1047 : _M_h(
std::
move(__umset._M_h), __a)
1055 const allocator_type& __a)
1059 template<
typename _InputIterator>
1062 const allocator_type& __a)
1066 template<
typename _InputIterator>
1068 size_type __n,
const hasher& __hf,
1069 const allocator_type& __a)
1075 const allocator_type& __a)
1080 size_type __n,
const hasher& __hf,
1081 const allocator_type& __a)
1106 {
return _M_h.get_allocator(); }
1111 _GLIBCXX_NODISCARD
bool
1113 {
return _M_h.empty(); }
1118 {
return _M_h.size(); }
1123 {
return _M_h.max_size(); }
1134 {
return _M_h.begin(); }
1137 begin() const noexcept
1138 {
return _M_h.begin(); }
1148 {
return _M_h.end(); }
1151 end() const noexcept
1152 {
return _M_h.end(); }
1161 {
return _M_h.begin(); }
1169 {
return _M_h.end(); }
1180 template<
typename... _Args>
1183 {
return _M_h.emplace(std::forward<_Args>(__args)...); }
1202 template<
typename... _Args>
1205 {
return _M_h.emplace_hint(__pos, std::forward<_Args>(__args)...); }
1217 {
return _M_h.insert(__x); }
1242 insert(const_iterator __hint,
const value_type& __x)
1243 {
return _M_h.insert(__hint, __x); }
1246 insert(const_iterator __hint, value_type&& __x)
1247 {
return _M_h.insert(__hint,
std::move(__x)); }
1258 template<
typename _InputIterator>
1260 insert(_InputIterator __first, _InputIterator __last)
1261 { _M_h.insert(__first, __last); }
1272 { _M_h.insert(__l); }
1274#if __cplusplus > 201402L
1277 extract(const_iterator __pos)
1279 __glibcxx_assert(__pos !=
end());
1280 return _M_h.extract(__pos);
1286 {
return _M_h.extract(__key); }
1291 {
return _M_h._M_reinsert_node_multi(
cend(),
std::move(__nh)); }
1295 insert(const_iterator __hint, node_type&& __nh)
1296 {
return _M_h._M_reinsert_node_multi(__hint,
std::move(__nh)); }
1316 {
return _M_h.erase(__position); }
1321 {
return _M_h.erase(__position); }
1339 {
return _M_h.erase(__x); }
1358 erase(const_iterator __first, const_iterator __last)
1359 {
return _M_h.erase(__first, __last); }
1383 noexcept(
noexcept(_M_h.swap(__x._M_h)) )
1384 { _M_h.swap(__x._M_h); }
1386#if __cplusplus > 201402L
1387 template<
typename,
typename,
typename>
1388 friend class std::_Hash_merge_helper;
1390 template<
typename _H2,
typename _P2>
1395 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1396 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1399 template<
typename _H2,
typename _P2>
1401 merge(unordered_multiset<_Value, _H2, _P2, _Alloc>&& __source)
1402 { merge(__source); }
1404 template<
typename _H2,
typename _P2>
1406 merge(unordered_set<_Value, _H2, _P2, _Alloc>& __source)
1409 = _Hash_merge_helper<unordered_multiset, _H2, _P2>;
1410 _M_h._M_merge_multi(_Merge_helper::_S_get_table(__source));
1413 template<
typename _H2,
typename _P2>
1415 merge(unordered_set<_Value, _H2, _P2, _Alloc>&& __source)
1416 { merge(__source); }
1425 {
return _M_h.hash_function(); }
1431 {
return _M_h.key_eq(); }
1449 {
return _M_h.find(__x); }
1453 {
return _M_h.find(__x); }
1463 {
return _M_h.count(__x); }
1465#if __cplusplus > 201703L
1472 contains(
const key_type& __x)
const
1473 {
return _M_h.find(__x) != _M_h.end(); }
1485 {
return _M_h.equal_range(__x); }
1489 {
return _M_h.equal_range(__x); }
1497 {
return _M_h.bucket_count(); }
1502 {
return _M_h.max_bucket_count(); }
1510 bucket_size(size_type __n)
const
1511 {
return _M_h.bucket_size(__n); }
1519 bucket(
const key_type& __key)
const
1520 {
return _M_h.bucket(__key); }
1531 {
return _M_h.begin(__n); }
1533 const_local_iterator
1534 begin(size_type __n)
const
1535 {
return _M_h.begin(__n); }
1537 const_local_iterator
1538 cbegin(size_type __n)
const
1539 {
return _M_h.cbegin(__n); }
1551 {
return _M_h.end(__n); }
1553 const_local_iterator
1554 end(size_type __n)
const
1555 {
return _M_h.end(__n); }
1557 const_local_iterator
1558 cend(size_type __n)
const
1559 {
return _M_h.cend(__n); }
1567 {
return _M_h.load_factor(); }
1573 {
return _M_h.max_load_factor(); }
1581 { _M_h.max_load_factor(__z); }
1592 { _M_h.rehash(__n); }
1603 { _M_h.reserve(__n); }
1605 template<
typename _Value1,
typename _Hash1,
typename _Pred1,
1613#if __cpp_deduction_guides >= 201606
1615 template<
typename _InputIterator,
1617 hash<typename iterator_traits<_InputIterator>::value_type>,
1619 equal_to<typename iterator_traits<_InputIterator>::value_type>,
1620 typename _Allocator =
1621 allocator<typename iterator_traits<_InputIterator>::value_type>,
1622 typename = _RequireInputIter<_InputIterator>,
1623 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1624 typename = _RequireNotAllocator<_Pred>,
1625 typename = _RequireAllocator<_Allocator>>
1626 unordered_multiset(_InputIterator, _InputIterator,
1627 unordered_multiset<int>::size_type = {},
1628 _Hash = _Hash(), _Pred = _Pred(),
1629 _Allocator = _Allocator())
1630 -> unordered_multiset<
typename iterator_traits<_InputIterator>::value_type,
1631 _Hash, _Pred, _Allocator>;
1633 template<
typename _Tp,
typename _Hash = hash<_Tp>,
1634 typename _Pred = equal_to<_Tp>,
1635 typename _Allocator = allocator<_Tp>,
1636 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1637 typename = _RequireNotAllocator<_Pred>,
1638 typename = _RequireAllocator<_Allocator>>
1639 unordered_multiset(initializer_list<_Tp>,
1640 unordered_multiset<int>::size_type = {},
1641 _Hash = _Hash(), _Pred = _Pred(),
1642 _Allocator = _Allocator())
1643 -> unordered_multiset<_Tp, _Hash, _Pred, _Allocator>;
1645 template<
typename _InputIterator,
typename _Allocator,
1646 typename = _RequireInputIter<_InputIterator>,
1647 typename = _RequireAllocator<_Allocator>>
1648 unordered_multiset(_InputIterator, _InputIterator,
1649 unordered_multiset<int>::size_type, _Allocator)
1650 -> unordered_multiset<typename iterator_traits<_InputIterator>::value_type,
1652 iterator_traits<_InputIterator>::value_type>,
1654 iterator_traits<_InputIterator>::value_type>,
1657 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1658 typename = _RequireInputIter<_InputIterator>,
1659 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1660 typename = _RequireAllocator<_Allocator>>
1661 unordered_multiset(_InputIterator, _InputIterator,
1662 unordered_multiset<int>::size_type,
1664 -> unordered_multiset<
typename
1665 iterator_traits<_InputIterator>::value_type,
1669 iterator_traits<_InputIterator>::value_type>,
1672 template<
typename _Tp,
typename _Allocator,
1673 typename = _RequireAllocator<_Allocator>>
1674 unordered_multiset(initializer_list<_Tp>,
1675 unordered_multiset<int>::size_type, _Allocator)
1676 -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
1678 template<
typename _Tp,
typename _Hash,
typename _Allocator,
1679 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1680 typename = _RequireAllocator<_Allocator>>
1681 unordered_multiset(initializer_list<_Tp>,
1682 unordered_multiset<int>::size_type, _Hash, _Allocator)
1683 -> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
1687 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1689 swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
1690 unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
1691 noexcept(
noexcept(__x.swap(__y)))
1694 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1696 swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1697 unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1698 noexcept(
noexcept(__x.swap(__y)))
1701 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1703 operator==(
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
1704 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
1705 {
return __x._M_h._M_equal(__y._M_h); }
1707 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1709 operator!=(
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
1710 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
1711 {
return !(__x == __y); }
1713 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1715 operator==(
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1716 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1717 {
return __x._M_h._M_equal(__y._M_h); }
1719 template<
class _Value,
class _Hash,
class _Pred,
class _Alloc>
1721 operator!=(
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1722 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1723 {
return !(__x == __y); }
1725_GLIBCXX_END_NAMESPACE_CONTAINER
1727#if __cplusplus > 201402L
1729 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
1730 typename _Hash2,
typename _Eq2>
1731 struct _Hash_merge_helper<
1732 _GLIBCXX_STD_C::unordered_set<_Val, _Hash1, _Eq1, _Alloc>, _Hash2, _Eq2>
1735 template<
typename... _Tp>
1736 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
1737 template<
typename... _Tp>
1738 using unordered_multiset = _GLIBCXX_STD_C::unordered_multiset<_Tp...>;
1740 friend unordered_set<_Val, _Hash1, _Eq1, _Alloc>;
1743 _S_get_table(unordered_set<_Val, _Hash2, _Eq2, _Alloc>& __set)
1744 {
return __set._M_h; }
1747 _S_get_table(unordered_multiset<_Val, _Hash2, _Eq2, _Alloc>& __set)
1748 {
return __set._M_h; }
1752 template<
typename _Val,
typename _Hash1,
typename _Eq1,
typename _Alloc,
1753 typename _Hash2,
typename _Eq2>
1754 struct _Hash_merge_helper<
1755 _GLIBCXX_STD_C::unordered_multiset<_Val, _Hash1, _Eq1, _Alloc>,
1759 template<
typename... _Tp>
1760 using unordered_set = _GLIBCXX_STD_C::unordered_set<_Tp...>;
1761 template<
typename... _Tp>
1762 using unordered_multiset = _GLIBCXX_STD_C::unordered_multiset<_Tp...>;
1764 friend unordered_multiset<_Val, _Hash1, _Eq1, _Alloc>;
1767 _S_get_table(unordered_set<_Val, _Hash2, _Eq2, _Alloc>& __set)
1768 {
return __set._M_h; }
1771 _S_get_table(unordered_multiset<_Val, _Hash2, _Eq2, _Alloc>& __set)
1772 {
return __set._M_h; }
1776_GLIBCXX_END_NAMESPACE_VERSION
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.
Primary class template hash.
The standard allocator, as per [20.4].
Default range hashing function: use division to fold a large number into the range [0,...
Default ranged hash function H. In principle it should be a function object composed from objects of ...
Default value for rehash policy. Bucket size is (usually) the smallest prime that keeps the load fact...
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.
void insert(initializer_list< value_type > __l)
Inserts a list of elements into the unordered_multiset.
_Hashtable::pointer pointer
Iterator-related typedefs.
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
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.
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::key_type key_type
Public typedefs.
unordered_multiset & operator=(const unordered_multiset &)=default
Copy assignment operator.
hasher hash_function() const
Returns the hash functor object with which the unordered_multiset was constructed.
unordered_multiset(initializer_list< value_type > __l, size_type __n=0, const hasher &__hf=hasher(), const key_equal &__eql=key_equal(), const allocator_type &__a=allocator_type())
Builds an unordered_multiset from an initializer_list.
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.
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.
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(const value_type &__x)
Inserts an element into the unordered_multiset.
void reserve(size_type __n)
Prepare the unordered_multiset for a specified number of elements.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_multiset.
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.
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.
unordered_multiset(const unordered_multiset &)=default
Copy constructor.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
allocator_type get_allocator() const noexcept
Returns the allocator object used by the unordered_multiset.
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.
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_iterator cend() const noexcept
_Hashtable::key_type key_type
Public typedefs.
size_type count(const key_type &__x) const
Finds the number of elements.
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.
unordered_set(unordered_set &&)=default
Move constructor.
unordered_set(const allocator_type &__a)
Creates an unordered_set with no elements.
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.
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.
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.
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.
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.
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-related typedefs.
iterator begin() noexcept
iterator find(const key_type &__x)
Tries to locate an element in an unordered_set.
size_type max_size() const noexcept
Returns the maximum size of the unordered_set.
size_type max_bucket_count() const noexcept
Returns the maximum number of buckets of the unordered_set.