29#ifndef _GLIBCXX_DEBUG_UNORDERED_SET
30#define _GLIBCXX_DEBUG_UNORDERED_SET 1
32#pragma GCC system_header
34#if __cplusplus < 201103L
38namespace std _GLIBCXX_VISIBILITY(default) {
namespace __debug {
39 template<
typename _Key,
typename _Hash,
typename _Pred,
typename _Allocator>
41 template<
typename _Key,
typename _Hash,
typename _Pred,
typename _Allocator>
42 class unordered_multiset;
51namespace std _GLIBCXX_VISIBILITY(default)
56 template<
typename _Value,
62 unordered_set<_Value, _Hash, _Pred, _Alloc>, _Alloc,
63 __gnu_debug::_Safe_unordered_container>,
64 public _GLIBCXX_STD_C::unordered_set<_Value, _Hash, _Pred, _Alloc>
66 typedef _GLIBCXX_STD_C::unordered_set<
67 _Value, _Hash, _Pred, _Alloc>
_Base;
76 template<
typename _ItT,
typename _SeqT,
typename _CatT>
77 friend class ::__gnu_debug::_Safe_iterator;
78 template<
typename _ItT,
typename _SeqT>
79 friend class ::__gnu_debug::_Safe_local_iterator;
84 _Base_ref(
const _Base& __r) : _M_ref(__r) { }
90 typedef typename _Base::size_type size_type;
91 typedef typename _Base::difference_type difference_type;
92 typedef typename _Base::hasher hasher;
93 typedef typename _Base::key_equal key_equal;
94 typedef typename _Base::allocator_type allocator_type;
96 typedef typename _Base::key_type key_type;
97 typedef typename _Base::value_type value_type;
99 typedef typename _Base::pointer pointer;
100 typedef typename _Base::const_pointer const_pointer;
101 typedef typename _Base::reference reference;
102 typedef typename _Base::const_reference const_reference;
116 const hasher& __hf = hasher(),
117 const key_equal& __eql = key_equal(),
118 const allocator_type& __a = allocator_type())
119 :
_Base(__n, __hf, __eql, __a) { }
121 template<
typename _InputIterator>
124 const hasher& __hf = hasher(),
125 const key_equal& __eql = key_equal(),
126 const allocator_type& __a = allocator_type())
128 __glibcxx_check_valid_constructor_range(__first, __last)),
130 __hf, __eql, __a) { }
135 :
_Base(__x._M_ref) { }
144 const allocator_type& __a)
145 :
_Base(__uset, __a) { }
148 const allocator_type& __a)
155 const hasher& __hf = hasher(),
156 const key_equal& __eql = key_equal(),
157 const allocator_type& __a = allocator_type())
158 :
_Base(__l, __n, __hf, __eql, __a) { }
165 const allocator_type& __a)
169 template<
typename _InputIterator>
172 const allocator_type& __a)
173 :
unordered_set(__first, __last, __n, hasher(), key_equal(), __a)
176 template<
typename _InputIterator>
178 size_type __n,
const hasher& __hf,
179 const allocator_type& __a)
180 :
unordered_set(__first, __last, __n, __hf, key_equal(), __a)
185 const allocator_type& __a)
190 size_type __n,
const hasher& __hf,
191 const allocator_type& __a)
206 _Base::operator=(__l);
207 this->_M_invalidate_all();
211 using _Base::get_allocator;
214 using _Base::max_size;
218 noexcept(
noexcept(declval<_Base&>().swap(__x)) )
228 this->_M_invalidate_all();
233 {
return { _Base::begin(),
this }; }
236 begin()
const noexcept
237 {
return { _Base::begin(),
this }; }
241 {
return { _Base::end(),
this }; }
245 {
return { _Base::end(),
this }; }
248 cbegin()
const noexcept
249 {
return { _Base::cbegin(),
this }; }
252 cend()
const noexcept
253 {
return { _Base::cend(),
this }; }
259 __glibcxx_check_bucket_index(__b);
260 return { _Base::begin(__b),
this };
266 __glibcxx_check_bucket_index(__b);
267 return { _Base::end(__b),
this };
271 begin(size_type __b)
const
273 __glibcxx_check_bucket_index(__b);
274 return { _Base::begin(__b),
this };
278 end(size_type __b)
const
280 __glibcxx_check_bucket_index(__b);
281 return { _Base::end(__b),
this };
285 cbegin(size_type __b)
const
287 __glibcxx_check_bucket_index(__b);
288 return { _Base::cbegin(__b),
this };
292 cend(size_type __b)
const
294 __glibcxx_check_bucket_index(__b);
295 return { _Base::cend(__b),
this };
298 using _Base::bucket_count;
299 using _Base::max_bucket_count;
302 bucket_size(size_type __b)
const
304 __glibcxx_check_bucket_index(__b);
305 return _Base::bucket_size(__b);
309 using _Base::load_factor;
312 max_load_factor()
const noexcept
313 {
return _Base::max_load_factor(); }
316 max_load_factor(
float __f)
318 __glibcxx_check_max_load_factor(__f);
319 _Base::max_load_factor(__f);
323 using _Base::reserve;
325 template<
typename... _Args>
327 emplace(_Args&&... __args)
329 size_type __bucket_count = this->bucket_count();
330 auto __res = _Base::emplace(std::forward<_Args>(__args)...);
331 _M_check_rehashed(__bucket_count);
332 return { { __res.first,
this }, __res.second };
335 template<
typename... _Args>
340 size_type __bucket_count = this->bucket_count();
341 auto __it = _Base::emplace_hint(__hint.
base(),
342 std::forward<_Args>(__args)...);
343 _M_check_rehashed(__bucket_count);
344 return { __it,
this };
348 insert(
const value_type& __obj)
350 size_type __bucket_count = this->bucket_count();
351 auto __res = _Base::insert(__obj);
352 _M_check_rehashed(__bucket_count);
353 return { { __res.first,
this }, __res.second };
360 size_type __bucket_count = this->bucket_count();
361 auto __it = _Base::insert(__hint.
base(), __obj);
362 _M_check_rehashed(__bucket_count);
363 return { __it,
this };
367 insert(value_type&& __obj)
369 size_type __bucket_count = this->bucket_count();
370 auto __res = _Base::insert(
std::move(__obj));
371 _M_check_rehashed(__bucket_count);
372 return { { __res.first,
this }, __res.second };
379 size_type __bucket_count = this->bucket_count();
381 _M_check_rehashed(__bucket_count);
382 return { __it,
this };
388 size_type __bucket_count = this->bucket_count();
390 _M_check_rehashed(__bucket_count);
393 template<
typename _InputIterator>
395 insert(_InputIterator __first, _InputIterator __last)
398 __glibcxx_check_valid_range2(__first, __last, __dist);
399 size_type __bucket_count = this->bucket_count();
401 if (__dist.
second >= __gnu_debug::__dp_sign)
402 _Base::insert(__gnu_debug::__unsafe(__first),
403 __gnu_debug::__unsafe(__last));
405 _Base::insert(__first, __last);
407 _M_check_rehashed(__bucket_count);
410#if __cplusplus > 201402L
411 using node_type =
typename _Base::node_type;
418 return _M_extract(__position.
base());
422 extract(
const key_type& __key)
424 const auto __position = _Base::find(__key);
425 if (__position != _Base::end())
426 return _M_extract(__position);
431 insert(node_type&& __nh)
433 auto __ret = _Base::insert(
std::move(__nh));
435 { { __ret.position,
this }, __ret.inserted,
std::move(__ret.node) };
442 return { _Base::insert(__hint.
base(),
std::move(__nh)),
this };
445 template<
typename _H2,
typename _P2>
450 = _Safe::_S_uc_guard(std::__detail::_Identity{}, __source);
451 _Base::merge(__source);
454 template<
typename _H2,
typename _P2>
459 template<
typename _H2,
typename _P2>
464 = _Safe::_S_umc_guard(std::__detail::_Identity{}, __source);
465 _Base::merge(__source);
468 template<
typename _H2,
typename _P2>
474 using _Base::hash_function;
478 find(
const key_type& __key)
479 {
return { _Base::find(__key),
this }; }
481#if __cplusplus > 201703L
482 template<
typename _Kt,
483 typename = std::__has_is_transparent_t<_Hash, _Kt>,
484 typename = std::__has_is_transparent_t<_Pred, _Kt>>
487 {
return { _Base::find(__k),
this }; }
491 find(
const key_type& __key)
const
492 {
return { _Base::find(__key),
this }; }
494#if __cplusplus > 201703L
495 template<
typename _Kt,
496 typename = std::__has_is_transparent_t<_Hash, _Kt>,
497 typename = std::__has_is_transparent_t<_Pred, _Kt>>
499 find(
const _Kt& __k)
const
500 {
return { _Base::find(__k),
this }; }
505#if __cplusplus > 201703L
506 using _Base::contains;
510 equal_range(
const key_type& __key)
512 auto __res = _Base::equal_range(__key);
513 return { { __res.first,
this }, { __res.second,
this } };
516#if __cplusplus > 201703L
517 template<
typename _Kt,
518 typename = std::__has_is_transparent_t<_Hash, _Kt>,
519 typename = std::__has_is_transparent_t<_Pred, _Kt>>
521 equal_range(
const _Kt& __k)
523 auto __res = _Base::equal_range(__k);
524 return { { __res.first,
this }, { __res.second,
this } };
529 equal_range(
const key_type& __key)
const
531 auto __res = _Base::equal_range(__key);
532 return { { __res.first,
this }, { __res.second,
this } };
535#if __cplusplus > 201703L
536 template<
typename _Kt,
537 typename = std::__has_is_transparent_t<_Hash, _Kt>,
538 typename = std::__has_is_transparent_t<_Pred, _Kt>>
540 equal_range(
const _Kt& __k)
const
542 auto __res = _Base::equal_range(__k);
543 return { { __res.first,
this }, { __res.second,
this } };
548 erase(
const key_type& __key)
551 auto __victim = _Base::find(__key);
552 if (__victim != _Base::end())
564 return { _M_erase(__it.
base()),
this };
570 __glibcxx_check_erase2(__it);
571 return _M_erase(__it);
578 return { _M_erase(__it.
base()),
this };
585 for (
auto __tmp = __first.base(); __tmp != __last.
base(); ++__tmp)
587 _GLIBCXX_DEBUG_VERIFY(__tmp != _Base::cend(),
588 _M_message(__gnu_debug::__msg_valid_range)
589 ._M_iterator(__first,
"first")
590 ._M_iterator(__last,
"last"));
591 _M_invalidate(__tmp);
594 size_type __bucket_count = this->bucket_count();
595 auto __next = _Base::erase(__first.base(), __last.
base());
596 _M_check_rehashed(__bucket_count);
597 return { __next,
this };
601 _M_base()
noexcept {
return *
this; }
604 _M_base()
const noexcept {
return *
this; }
608 _M_check_rehashed(size_type __prev_count)
610 if (__prev_count != this->bucket_count())
611 this->_M_invalidate_all();
617 this->_M_invalidate_if(
619 this->_M_invalidate_local_if(
621 {
return __it == __victim; });
627 _M_invalidate(__victim);
628 size_type __bucket_count = this->bucket_count();
630 _M_check_rehashed(__bucket_count);
634#if __cplusplus > 201402L
638 _M_invalidate(__victim);
639 return _Base::extract(__victim);
644#if __cpp_deduction_guides >= 201606
646 template<
typename _InputIterator,
651 typename _Allocator =
653 typename = _RequireInputIter<_InputIterator>,
654 typename = _RequireNotAllocatorOrIntegral<_Hash>,
655 typename = _RequireNotAllocator<_Pred>,
656 typename = _RequireAllocator<_Allocator>>
658 unordered_set<int>::size_type = {},
659 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
661 _Hash, _Pred, _Allocator>;
663 template<
typename _Tp,
typename _Hash = hash<_Tp>,
664 typename _Pred = equal_to<_Tp>,
665 typename _Allocator = allocator<_Tp>,
666 typename = _RequireNotAllocatorOrIntegral<_Hash>,
667 typename = _RequireNotAllocator<_Pred>,
668 typename = _RequireAllocator<_Allocator>>
671 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
672 -> unordered_set<_Tp, _Hash, _Pred, _Allocator>;
674 template<
typename _InputIterator,
typename _Allocator,
675 typename = _RequireInputIter<_InputIterator>,
676 typename = _RequireAllocator<_Allocator>>
677 unordered_set(_InputIterator, _InputIterator,
678 unordered_set<int>::size_type, _Allocator)
679 -> unordered_set<typename iterator_traits<_InputIterator>::value_type,
681 typename iterator_traits<_InputIterator>::value_type>,
683 typename iterator_traits<_InputIterator>::value_type>,
686 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
687 typename = _RequireInputIter<_InputIterator>,
688 typename = _RequireNotAllocatorOrIntegral<_Hash>,
689 typename = _RequireAllocator<_Allocator>>
690 unordered_set(_InputIterator, _InputIterator,
691 unordered_set<int>::size_type,
693 -> unordered_set<typename iterator_traits<_InputIterator>::value_type,
696 typename iterator_traits<_InputIterator>::value_type>,
699 template<
typename _Tp,
typename _Allocator,
700 typename = _RequireAllocator<_Allocator>>
701 unordered_set(initializer_list<_Tp>,
702 unordered_set<int>::size_type, _Allocator)
703 -> unordered_set<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
705 template<
typename _Tp,
typename _Hash,
typename _Allocator,
706 typename = _RequireNotAllocatorOrIntegral<_Hash>,
707 typename = _RequireAllocator<_Allocator>>
708 unordered_set(initializer_list<_Tp>,
709 unordered_set<int>::size_type, _Hash, _Allocator)
710 -> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
714 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
716 swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
717 unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
718 noexcept(
noexcept(__x.swap(__y)))
721 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
723 operator==(
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
724 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
725 {
return __x._M_base() == __y._M_base(); }
727#if __cpp_impl_three_way_comparison < 201907L
728 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
730 operator!=(
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
731 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
732 {
return !(__x == __y); }
736 template<
typename _Value,
742 unordered_multiset<_Value, _Hash, _Pred, _Alloc>, _Alloc,
743 __gnu_debug::_Safe_unordered_container>,
744 public _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash, _Pred, _Alloc>
746 typedef _GLIBCXX_STD_C::unordered_multiset<
747 _Value, _Hash, _Pred, _Alloc>
_Base;
756 template<
typename _ItT,
typename _SeqT,
typename _CatT>
757 friend class ::__gnu_debug::_Safe_iterator;
758 template<
typename _ItT,
typename _SeqT>
759 friend class ::__gnu_debug::_Safe_local_iterator;
764 _Base_ref(
const _Base& __r) : _M_ref(__r) { }
770 typedef typename _Base::size_type size_type;
771 typedef typename _Base::difference_type difference_type;
772 typedef typename _Base::hasher hasher;
773 typedef typename _Base::key_equal key_equal;
774 typedef typename _Base::allocator_type allocator_type;
776 typedef typename _Base::key_type key_type;
777 typedef typename _Base::value_type value_type;
779 typedef typename _Base::pointer pointer;
780 typedef typename _Base::const_pointer const_pointer;
781 typedef typename _Base::reference reference;
782 typedef typename _Base::const_reference const_reference;
796 const hasher& __hf = hasher(),
797 const key_equal& __eql = key_equal(),
798 const allocator_type& __a = allocator_type())
799 :
_Base(__n, __hf, __eql, __a) { }
801 template<
typename _InputIterator>
804 const hasher& __hf = hasher(),
805 const key_equal& __eql = key_equal(),
806 const allocator_type& __a = allocator_type())
808 __glibcxx_check_valid_constructor_range(__first, __last)),
810 __hf, __eql, __a) { }
815 :
_Base(__x._M_ref) { }
824 const allocator_type& __a)
825 :
_Base(__uset, __a) { }
828 const allocator_type& __a)
835 const hasher& __hf = hasher(),
836 const key_equal& __eql = key_equal(),
837 const allocator_type& __a = allocator_type())
838 :
_Base(__l, __n, __hf, __eql, __a) { }
845 const allocator_type& __a)
849 template<
typename _InputIterator>
852 const allocator_type& __a)
856 template<
typename _InputIterator>
858 size_type __n,
const hasher& __hf,
859 const allocator_type& __a)
865 const allocator_type& __a)
870 size_type __n,
const hasher& __hf,
871 const allocator_type& __a)
886 _Base::operator=(__l);
887 this->_M_invalidate_all();
891 using _Base::get_allocator;
894 using _Base::max_size;
898 noexcept(
noexcept(declval<_Base&>().swap(__x)) )
908 this->_M_invalidate_all();
913 {
return { _Base::begin(),
this }; }
916 begin()
const noexcept
917 {
return { _Base::begin(),
this }; }
921 {
return { _Base::end(),
this }; }
925 {
return { _Base::end(),
this }; }
928 cbegin()
const noexcept
929 {
return { _Base::cbegin(),
this }; }
932 cend()
const noexcept
933 {
return { _Base::cend(),
this }; }
939 __glibcxx_check_bucket_index(__b);
940 return { _Base::begin(__b),
this };
946 __glibcxx_check_bucket_index(__b);
947 return { _Base::end(__b),
this };
951 begin(size_type __b)
const
953 __glibcxx_check_bucket_index(__b);
954 return { _Base::begin(__b),
this };
958 end(size_type __b)
const
960 __glibcxx_check_bucket_index(__b);
961 return { _Base::end(__b),
this };
965 cbegin(size_type __b)
const
967 __glibcxx_check_bucket_index(__b);
968 return { _Base::cbegin(__b),
this };
972 cend(size_type __b)
const
974 __glibcxx_check_bucket_index(__b);
975 return { _Base::cend(__b),
this };
978 using _Base::bucket_count;
979 using _Base::max_bucket_count;
982 bucket_size(size_type __b)
const
984 __glibcxx_check_bucket_index(__b);
985 return _Base::bucket_size(__b);
989 using _Base::load_factor;
992 max_load_factor()
const noexcept
993 {
return _Base::max_load_factor(); }
996 max_load_factor(
float __f)
998 __glibcxx_check_max_load_factor(__f);
999 _Base::max_load_factor(__f);
1002 using _Base::rehash;
1003 using _Base::reserve;
1005 template<
typename... _Args>
1007 emplace(_Args&&... __args)
1009 size_type __bucket_count = this->bucket_count();
1010 auto __it = _Base::emplace(std::forward<_Args>(__args)...);
1011 _M_check_rehashed(__bucket_count);
1012 return { __it,
this };
1015 template<
typename... _Args>
1020 size_type __bucket_count = this->bucket_count();
1021 auto __it = _Base::emplace_hint(__hint.
base(),
1022 std::forward<_Args>(__args)...);
1023 _M_check_rehashed(__bucket_count);
1024 return { __it,
this };
1028 insert(
const value_type& __obj)
1030 size_type __bucket_count = this->bucket_count();
1031 auto __it = _Base::insert(__obj);
1032 _M_check_rehashed(__bucket_count);
1033 return { __it,
this };
1040 size_type __bucket_count = this->bucket_count();
1041 auto __it = _Base::insert(__hint.
base(), __obj);
1042 _M_check_rehashed(__bucket_count);
1043 return { __it,
this };
1047 insert(value_type&& __obj)
1049 size_type __bucket_count = this->bucket_count();
1050 auto __it = _Base::insert(
std::move(__obj));
1051 _M_check_rehashed(__bucket_count);
1052 return { __it,
this };
1059 size_type __bucket_count = this->bucket_count();
1061 _M_check_rehashed(__bucket_count);
1062 return { __it,
this };
1068 size_type __bucket_count = this->bucket_count();
1070 _M_check_rehashed(__bucket_count);
1073 template<
typename _InputIterator>
1075 insert(_InputIterator __first, _InputIterator __last)
1078 __glibcxx_check_valid_range2(__first, __last, __dist);
1079 size_type __bucket_count = this->bucket_count();
1081 if (__dist.
second >= __gnu_debug::__dp_sign)
1082 _Base::insert(__gnu_debug::__unsafe(__first),
1083 __gnu_debug::__unsafe(__last));
1085 _Base::insert(__first, __last);
1087 _M_check_rehashed(__bucket_count);
1090#if __cplusplus > 201402L
1091 using node_type =
typename _Base::node_type;
1097 return _M_extract(__position.
base());
1101 extract(
const key_type& __key)
1103 const auto __position = _Base::find(__key);
1104 if (__position != _Base::end())
1105 return _M_extract(__position);
1110 insert(node_type&& __nh)
1111 {
return { _Base::insert(
std::move(__nh)),
this }; }
1117 return { _Base::insert(__hint.
base(),
std::move(__nh)),
this };
1120 template<
typename _H2,
typename _P2>
1125 = _Safe::_S_umc_guard(std::__detail::_Identity{}, __source);
1126 _Base::merge(__source);
1129 template<
typename _H2,
typename _P2>
1132 { merge(__source); }
1134 template<
typename _H2,
typename _P2>
1139 = _Safe::_S_uc_guard(std::__detail::_Identity{}, __source);
1140 _Base::merge(__source);
1143 template<
typename _H2,
typename _P2>
1146 { merge(__source); }
1149 using _Base::hash_function;
1150 using _Base::key_eq;
1153 find(
const key_type& __key)
1154 {
return { _Base::find(__key),
this }; }
1156#if __cplusplus > 201703L
1157 template<
typename _Kt,
1158 typename = std::__has_is_transparent_t<_Hash, _Kt>,
1159 typename = std::__has_is_transparent_t<_Pred, _Kt>>
1161 find(
const _Kt& __k)
1162 {
return { _Base::find(__k),
this }; }
1166 find(
const key_type& __key)
const
1167 {
return { _Base::find(__key),
this }; }
1169#if __cplusplus > 201703L
1170 template<
typename _Kt,
1171 typename = std::__has_is_transparent_t<_Hash, _Kt>,
1172 typename = std::__has_is_transparent_t<_Pred, _Kt>>
1174 find(
const _Kt& __k)
const
1175 {
return { _Base::find(__k),
this }; }
1180#if __cplusplus > 201703L
1181 using _Base::contains;
1185 equal_range(
const key_type& __key)
1187 auto __res = _Base::equal_range(__key);
1188 return { { __res.first,
this }, { __res.second,
this } };
1191#if __cplusplus > 201703L
1192 template<
typename _Kt,
1193 typename = std::__has_is_transparent_t<_Hash, _Kt>,
1194 typename = std::__has_is_transparent_t<_Pred, _Kt>>
1196 equal_range(
const _Kt& __k)
1198 auto __res = _Base::equal_range(__k);
1199 return { { __res.first,
this }, { __res.second,
this } };
1204 equal_range(
const key_type& __key)
const
1206 auto __res = _Base::equal_range(__key);
1207 return { { __res.first,
this }, { __res.second,
this } };
1210#if __cplusplus > 201703L
1211 template<
typename _Kt,
1212 typename = std::__has_is_transparent_t<_Hash, _Kt>,
1213 typename = std::__has_is_transparent_t<_Pred, _Kt>>
1215 equal_range(
const _Kt& __k)
const
1217 auto __res = _Base::equal_range(__k);
1218 return { { __res.first,
this }, { __res.second,
this } };
1223 erase(
const key_type& __key)
1226 auto __pair = _Base::equal_range(__key);
1227 for (
auto __victim = __pair.first; __victim != __pair.second;)
1229 _M_invalidate(__victim);
1230 __victim = _Base::erase(__victim);
1241 return { _M_erase(__it.
base()),
this };
1247 __glibcxx_check_erase2(__it);
1248 return _M_erase(__it);
1255 return { _M_erase(__it.
base()),
this };
1262 for (
auto __tmp = __first.base(); __tmp != __last.
base(); ++__tmp)
1264 _GLIBCXX_DEBUG_VERIFY(__tmp != _Base::cend(),
1265 _M_message(__gnu_debug::__msg_valid_range)
1266 ._M_iterator(__first,
"first")
1267 ._M_iterator(__last,
"last"));
1268 _M_invalidate(__tmp);
1270 return { _Base::erase(__first.base(), __last.
base()),
this };
1274 _M_base()
noexcept {
return *
this; }
1277 _M_base()
const noexcept {
return *
this; }
1281 _M_check_rehashed(size_type __prev_count)
1283 if (__prev_count != this->bucket_count())
1284 this->_M_invalidate_all();
1290 this->_M_invalidate_if(
1292 this->_M_invalidate_local_if(
1294 {
return __it == __victim; });
1300 _M_invalidate(__victim);
1301 size_type __bucket_count = this->bucket_count();
1303 _M_check_rehashed(__bucket_count);
1307#if __cplusplus > 201402L
1311 _M_invalidate(__victim);
1312 return _Base::extract(__victim);
1317#if __cpp_deduction_guides >= 201606
1319 template<
typename _InputIterator,
1324 typename _Allocator =
1326 typename = _RequireInputIter<_InputIterator>,
1327 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1328 typename = _RequireNotAllocator<_Pred>,
1329 typename = _RequireAllocator<_Allocator>>
1331 unordered_multiset<int>::size_type = {},
1332 _Hash = _Hash(), _Pred = _Pred(),
1333 _Allocator = _Allocator())
1335 _Hash, _Pred, _Allocator>;
1337 template<
typename _Tp,
typename _Hash = hash<_Tp>,
1338 typename _Pred = equal_to<_Tp>,
1339 typename _Allocator = allocator<_Tp>,
1340 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1341 typename = _RequireNotAllocator<_Pred>,
1342 typename = _RequireAllocator<_Allocator>>
1345 _Hash = _Hash(), _Pred = _Pred(),
1346 _Allocator = _Allocator())
1347 -> unordered_multiset<_Tp, _Hash, _Pred, _Allocator>;
1349 template<
typename _InputIterator,
typename _Allocator,
1350 typename = _RequireInputIter<_InputIterator>,
1351 typename = _RequireAllocator<_Allocator>>
1352 unordered_multiset(_InputIterator, _InputIterator,
1353 unordered_multiset<int>::size_type, _Allocator)
1354 -> unordered_multiset<typename iterator_traits<_InputIterator>::value_type,
1356 iterator_traits<_InputIterator>::value_type>,
1358 iterator_traits<_InputIterator>::value_type>,
1361 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1362 typename = _RequireInputIter<_InputIterator>,
1363 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1364 typename = _RequireAllocator<_Allocator>>
1365 unordered_multiset(_InputIterator, _InputIterator,
1366 unordered_multiset<int>::size_type,
1368 -> unordered_multiset<
typename
1369 iterator_traits<_InputIterator>::value_type,
1373 iterator_traits<_InputIterator>::value_type>,
1376 template<
typename _Tp,
typename _Allocator,
1377 typename = _RequireAllocator<_Allocator>>
1378 unordered_multiset(initializer_list<_Tp>,
1379 unordered_multiset<int>::size_type, _Allocator)
1380 -> unordered_multiset<_Tp, hash<_Tp>, equal_to<_Tp>, _Allocator>;
1382 template<
typename _Tp,
typename _Hash,
typename _Allocator,
1383 typename = _RequireNotAllocatorOrIntegral<_Hash>,
1384 typename = _RequireAllocator<_Allocator>>
1385 unordered_multiset(initializer_list<_Tp>,
1386 unordered_multiset<int>::size_type, _Hash, _Allocator)
1387 -> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
1391 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
1393 swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1394 unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1395 noexcept(
noexcept(__x.swap(__y)))
1398 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
1400 operator==(
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1401 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1402 {
return __x._M_base() == __y._M_base(); }
1404#if __cpp_impl_three_way_comparison < 201907L
1405 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
1407 operator!=(
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
1408 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
1409 {
return !(__x == __y); }
#define __glibcxx_check_insert(_Position)
#define __glibcxx_check_erase_range(_First, _Last)
#define __glibcxx_check_erase(_Position)
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.
constexpr _Iterator __base(_Iterator __it)
Primary class template hash.
The standard allocator, as per C++03 [20.4.1].
constexpr _Iterator & base() noexcept
Return the underlying iterator.
Traits class for iterators.
Return type of insert(node_handle&&) on unique maps/sets.
One of the comparison functors.
Struct holding two objects of arbitrary type.
_T2 second
The second member.
A standard container composed of equivalent keys (possibly containing multiple of each key value) in ...
_Hashtable::size_type size_type
Iterator-related typedefs.
A standard container composed of unique keys (containing at most one of each key value) in which the ...
_Hashtable::size_type size_type
Iterator-related typedefs.
Safe class dealing with some allocator dependent operations.
Base class for constructing a safe unordered container type that tracks iterators that reference it.
Class std::unordered_set with safety/checking/debug instrumentation.
Class std::unordered_multiset with safety/checking/debug instrumentation.