29 #ifndef _GLIBCXX_DEBUG_UNORDERED_MAP
30 #define _GLIBCXX_DEBUG_UNORDERED_MAP 1
32 #pragma GCC system_header
34 #if __cplusplus < 201103L
44 namespace std _GLIBCXX_VISIBILITY(default)
49 template<
typename _Key,
typename _Tp,
55 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>, _Alloc,
56 __gnu_debug::_Safe_unordered_container>,
57 public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>
59 typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash,
63 typedef typename _Base::const_iterator _Base_const_iterator;
64 typedef typename _Base::iterator _Base_iterator;
65 typedef typename _Base::const_local_iterator
66 _Base_const_local_iterator;
67 typedef typename _Base::local_iterator _Base_local_iterator;
70 typedef typename _Base::size_type size_type;
71 typedef typename _Base::hasher hasher;
72 typedef typename _Base::key_equal key_equal;
73 typedef typename _Base::allocator_type allocator_type;
75 typedef typename _Base::key_type key_type;
76 typedef typename _Base::value_type value_type;
91 const hasher& __hf = hasher(),
92 const key_equal& __eql = key_equal(),
93 const allocator_type& __a = allocator_type())
94 :
_Base(__n, __hf, __eql, __a) { }
96 template<
typename _InputIterator>
99 const hasher& __hf = hasher(),
100 const key_equal& __eql = key_equal(),
101 const allocator_type& __a = allocator_type())
102 :
_Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
104 __gnu_debug::__base(__last), __n,
105 __hf, __eql, __a) { }
119 const allocator_type& __a)
120 :
_Base(__umap, __a) { }
123 const allocator_type& __a)
124 :
_Safe(std::move(__umap._M_safe()), __a),
125 _Base(std::move(__umap._M_base()), __a) { }
129 const hasher& __hf = hasher(),
130 const key_equal& __eql = key_equal(),
131 const allocator_type& __a = allocator_type())
132 :
_Base(__l, __n, __hf, __eql, __a) { }
140 const allocator_type& __a)
144 template<
typename _InputIterator>
147 const allocator_type& __a)
148 :
unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
151 template<
typename _InputIterator>
155 const allocator_type& __a)
156 :
unordered_map(__first, __last, __n, __hf, key_equal(), __a)
161 const allocator_type& __a)
168 const allocator_type& __a)
184 this->_M_invalidate_all();
190 noexcept( noexcept(declval<_Base&>().swap(__x)) )
200 this->_M_invalidate_all();
205 {
return iterator(_Base::begin(),
this); }
208 begin()
const noexcept
213 {
return iterator(_Base::end(),
this); }
220 cbegin()
const noexcept
224 cend()
const noexcept
231 __glibcxx_check_bucket_index(__b);
238 __glibcxx_check_bucket_index(__b);
243 begin(size_type __b)
const
245 __glibcxx_check_bucket_index(__b);
250 end(size_type __b)
const
252 __glibcxx_check_bucket_index(__b);
257 cbegin(size_type __b)
const
259 __glibcxx_check_bucket_index(__b);
264 cend(size_type __b)
const
266 __glibcxx_check_bucket_index(__b);
271 bucket_size(size_type __b)
const
273 __glibcxx_check_bucket_index(__b);
274 return _Base::bucket_size(__b);
278 max_load_factor()
const noexcept
279 {
return _Base::max_load_factor(); }
282 max_load_factor(
float __f)
284 __glibcxx_check_max_load_factor(__f);
285 _Base::max_load_factor(__f);
288 template<
typename... _Args>
290 emplace(_Args&&... __args)
292 size_type __bucket_count = this->bucket_count();
294 = _Base::emplace(std::forward<_Args>(__args)...);
295 _M_check_rehashed(__bucket_count);
299 template<
typename... _Args>
304 size_type __bucket_count = this->bucket_count();
305 _Base_iterator __it = _Base::emplace_hint(__hint.
base(),
306 std::forward<_Args>(__args)...);
307 _M_check_rehashed(__bucket_count);
312 insert(
const value_type& __obj)
314 size_type __bucket_count = this->bucket_count();
315 auto __res = _Base::insert(__obj);
316 _M_check_rehashed(__bucket_count);
317 return {
iterator(__res.first,
this), __res.second };
323 insert(value_type&& __x)
325 size_type __bucket_count = this->bucket_count();
326 auto __res = _Base::insert(std::move(__x));
327 _M_check_rehashed(__bucket_count);
328 return {
iterator(__res.first,
this), __res.second };
331 template<
typename _Pair,
typename =
typename
333 _Pair&&>::value>::type>
335 insert(_Pair&& __obj)
337 size_type __bucket_count = this->bucket_count();
339 _Base::insert(std::forward<_Pair>(__obj));
340 _M_check_rehashed(__bucket_count);
348 size_type __bucket_count = this->bucket_count();
349 _Base_iterator __it = _Base::insert(__hint.
base(), __obj);
350 _M_check_rehashed(__bucket_count);
360 size_type __bucket_count = this->bucket_count();
361 auto __it = _Base::insert(__hint.
base(), std::move(__x));
362 _M_check_rehashed(__bucket_count);
366 template<
typename _Pair,
typename =
typename
368 _Pair&&>::value>::type>
373 size_type __bucket_count = this->bucket_count();
374 _Base_iterator __it =
375 _Base::insert(__hint.
base(), std::forward<_Pair>(__obj));
376 _M_check_rehashed(__bucket_count);
383 size_type __bucket_count = this->bucket_count();
385 _M_check_rehashed(__bucket_count);
388 template<
typename _InputIterator>
390 insert(_InputIterator __first, _InputIterator __last)
393 __glibcxx_check_valid_range2(__first, __last, __dist);
394 size_type __bucket_count = this->bucket_count();
396 if (__dist.
second >= __gnu_debug::__dp_sign)
397 _Base::insert(__gnu_debug::__unsafe(__first),
398 __gnu_debug::__unsafe(__last));
400 _Base::insert(__first, __last);
402 _M_check_rehashed(__bucket_count);
405 #if __cplusplus > 201402L
406 template <
typename... _Args>
408 try_emplace(
const key_type& __k, _Args&&... __args)
410 auto __res = _Base::try_emplace(__k,
411 std::forward<_Args>(__args)...);
412 return {
iterator(__res.first,
this), __res.second };
415 template <
typename... _Args>
417 try_emplace(key_type&& __k, _Args&&... __args)
419 auto __res = _Base::try_emplace(std::move(__k),
420 std::forward<_Args>(__args)...);
421 return {
iterator(__res.first,
this), __res.second };
424 template <
typename... _Args>
431 std::forward<_Args>(__args)...),
435 template <
typename... _Args>
437 try_emplace(
const_iterator __hint, key_type&& __k, _Args&&... __args)
440 return iterator(_Base::try_emplace(__hint.
base(), std::move(__k),
441 std::forward<_Args>(__args)...),
445 template <
typename _Obj>
447 insert_or_assign(
const key_type& __k, _Obj&& __obj)
449 auto __res = _Base::insert_or_assign(__k,
450 std::forward<_Obj>(__obj));
451 return {
iterator(__res.first,
this), __res.second };
454 template <
typename _Obj>
456 insert_or_assign(key_type&& __k, _Obj&& __obj)
458 auto __res = _Base::insert_or_assign(std::move(__k),
459 std::forward<_Obj>(__obj));
460 return {
iterator(__res.first,
this), __res.second };
463 template <
typename _Obj>
469 return iterator(_Base::insert_or_assign(__hint.
base(), __k,
470 std::forward<_Obj>(__obj)),
474 template <
typename _Obj>
476 insert_or_assign(
const_iterator __hint, key_type&& __k, _Obj&& __obj)
481 std::forward<_Obj>(__obj)),
486 #if __cplusplus > 201402L
487 using node_type =
typename _Base::node_type;
488 using insert_return_type = _Node_insert_return<iterator, node_type>;
494 _Base_const_iterator __victim = __position.
base();
496 [__victim](_Base_const_iterator __it) {
return __it == __victim; }
499 [__victim](_Base_const_local_iterator __it) {
500 return __it._M_curr() == __victim._M_cur;
502 return _Base::extract(__position.
base());
506 extract(
const key_type& __key)
508 const auto __position = find(__key);
509 if (__position != end())
510 return extract(__position);
515 insert(node_type&& __nh)
517 auto __ret = _Base::insert(std::move(__nh));
519 return { __pos, __ret.inserted, std::move(__ret.node) };
526 return iterator(_Base::insert(__hint.
base(), std::move(__nh)),
this);
533 find(
const key_type& __key)
534 {
return iterator(_Base::find(__key),
this); }
537 find(
const key_type& __key)
const
541 equal_range(
const key_type& __key)
544 _Base::equal_range(__key);
550 equal_range(
const key_type& __key)
const
553 _Base::equal_range(__key);
559 erase(
const key_type& __key)
562 _Base_iterator __victim(_Base::find(__key));
563 if (__victim != _Base::end())
566 {
return __it == __victim; });
568 [__victim](_Base_const_local_iterator __it)
569 {
return __it._M_curr() == __victim._M_cur; });
570 size_type __bucket_count = this->bucket_count();
571 _Base::erase(__victim);
572 _M_check_rehashed(__bucket_count);
582 _Base_const_iterator __victim = __it.
base();
584 {
return __it == __victim; });
586 [__victim](_Base_const_local_iterator __it)
587 {
return __it._M_curr() == __victim._M_cur; });
588 size_type __bucket_count = this->bucket_count();
589 _Base_iterator __next = _Base::erase(__it.base());
590 _M_check_rehashed(__bucket_count);
602 for (_Base_const_iterator __tmp = __first.
base();
603 __tmp != __last.
base(); ++__tmp)
605 _GLIBCXX_DEBUG_VERIFY(__tmp != _Base::end(),
606 _M_message(__gnu_debug::__msg_valid_range)
607 ._M_iterator(__first,
"first")
608 ._M_iterator(__last,
"last"));
610 {
return __it == __tmp; });
612 [__tmp](_Base_const_local_iterator __it)
613 {
return __it._M_curr() == __tmp._M_cur; });
615 size_type __bucket_count = this->bucket_count();
616 _Base_iterator __next = _Base::erase(__first.
base(), __last.
base());
617 _M_check_rehashed(__bucket_count);
622 _M_base() noexcept {
return *
this; }
625 _M_base()
const noexcept {
return *
this; }
629 _M_check_rehashed(size_type __prev_count)
631 if (__prev_count != this->bucket_count())
632 this->_M_invalidate_locals();
636 #if __cpp_deduction_guides >= 201606
638 template<
typename _InputIterator,
642 typename = _RequireInputIter<_InputIterator>,
643 typename = _RequireAllocator<_Allocator>>
645 typename unordered_map<int, int>::size_type = {},
646 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
648 __iter_val_t<_InputIterator>,
649 _Hash, _Pred, _Allocator>;
651 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
652 typename _Pred = equal_to<_Key>,
653 typename _Allocator = allocator<pair<const _Key, _Tp>>,
654 typename = _RequireAllocator<_Allocator>>
657 _Hash = _Hash(), _Pred = _Pred(), _Allocator = _Allocator())
658 -> unordered_map<_Key, _Tp, _Hash, _Pred, _Allocator>;
660 template<
typename _InputIterator,
typename _Allocator,
661 typename = _RequireInputIter<_InputIterator>,
662 typename = _RequireAllocator<_Allocator>>
663 unordered_map(_InputIterator, _InputIterator,
664 typename unordered_map<int, int>::size_type, _Allocator)
665 -> unordered_map<__iter_key_t<_InputIterator>,
666 __iter_val_t<_InputIterator>,
667 hash<__iter_key_t<_InputIterator>>,
668 equal_to<__iter_key_t<_InputIterator>>,
671 template<
typename _InputIterator,
typename _Allocator,
672 typename = _RequireInputIter<_InputIterator>,
673 typename = _RequireAllocator<_Allocator>>
674 unordered_map(_InputIterator, _InputIterator, _Allocator)
675 -> unordered_map<__iter_key_t<_InputIterator>,
676 __iter_val_t<_InputIterator>,
677 hash<__iter_key_t<_InputIterator>>,
678 equal_to<__iter_key_t<_InputIterator>>,
681 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
682 typename = _RequireInputIter<_InputIterator>,
683 typename = _RequireAllocator<_Allocator>>
684 unordered_map(_InputIterator, _InputIterator,
685 typename unordered_map<int, int>::size_type,
687 -> unordered_map<__iter_key_t<_InputIterator>,
688 __iter_val_t<_InputIterator>, _Hash,
689 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
691 template<
typename _Key,
typename _Tp,
typename _Allocator,
692 typename = _RequireAllocator<_Allocator>>
693 unordered_map(initializer_list<pair<_Key, _Tp>>,
694 typename unordered_map<int, int>::size_type,
696 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
698 template<
typename _Key,
typename _Tp,
typename _Allocator,
699 typename = _RequireAllocator<_Allocator>>
700 unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
701 -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
703 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
704 typename = _RequireAllocator<_Allocator>>
705 unordered_map(initializer_list<pair<_Key, _Tp>>,
706 typename unordered_map<int, int>::size_type,
708 -> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
712 template<
typename _Key,
typename _Tp,
typename _Hash,
713 typename _Pred,
typename _Alloc>
715 swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
716 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
717 noexcept(noexcept(__x.swap(__y)))
720 template<
typename _Key,
typename _Tp,
typename _Hash,
721 typename _Pred,
typename _Alloc>
723 operator==(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
724 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
725 {
return __x._M_base() == __y._M_base(); }
727 template<
typename _Key,
typename _Tp,
typename _Hash,
728 typename _Pred,
typename _Alloc>
730 operator!=(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
731 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
732 {
return !(__x == __y); }
736 template<
typename _Key,
typename _Tp,
742 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>, _Alloc,
743 __gnu_debug::_Safe_unordered_container>,
744 public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>
746 typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
747 _Pred, _Alloc>
_Base;
750 typedef typename _Base::const_iterator _Base_const_iterator;
751 typedef typename _Base::iterator _Base_iterator;
752 typedef typename _Base::const_local_iterator _Base_const_local_iterator;
753 typedef typename _Base::local_iterator _Base_local_iterator;
756 typedef typename _Base::size_type size_type;
757 typedef typename _Base::hasher hasher;
758 typedef typename _Base::key_equal key_equal;
759 typedef typename _Base::allocator_type allocator_type;
761 typedef typename _Base::key_type key_type;
762 typedef typename _Base::value_type value_type;
777 const hasher& __hf = hasher(),
778 const key_equal& __eql = key_equal(),
779 const allocator_type& __a = allocator_type())
780 :
_Base(__n, __hf, __eql, __a) { }
782 template<
typename _InputIterator>
785 const hasher& __hf = hasher(),
786 const key_equal& __eql = key_equal(),
787 const allocator_type& __a = allocator_type())
788 :
_Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
790 __gnu_debug::__base(__last), __n,
791 __hf, __eql, __a) { }
805 const allocator_type& __a)
806 :
_Base(__umap, __a) { }
809 const allocator_type& __a)
810 :
_Safe(std::move(__umap._M_safe()), __a),
811 _Base(std::move(__umap._M_base()), __a) { }
815 const hasher& __hf = hasher(),
816 const key_equal& __eql = key_equal(),
817 const allocator_type& __a = allocator_type())
818 :
_Base(__l, __n, __hf, __eql, __a) { }
825 const allocator_type& __a)
829 template<
typename _InputIterator>
832 const allocator_type& __a)
836 template<
typename _InputIterator>
838 size_type __n,
const hasher& __hf,
839 const allocator_type& __a)
845 const allocator_type& __a)
850 size_type __n,
const hasher& __hf,
851 const allocator_type& __a)
866 this->_M_base() = __l;
867 this->_M_invalidate_all();
873 noexcept( noexcept(declval<_Base&>().swap(__x)) )
883 this->_M_invalidate_all();
888 {
return iterator(_Base::begin(),
this); }
891 begin()
const noexcept
896 {
return iterator(_Base::end(),
this); }
903 cbegin()
const noexcept
907 cend()
const noexcept
914 __glibcxx_check_bucket_index(__b);
921 __glibcxx_check_bucket_index(__b);
926 begin(size_type __b)
const
928 __glibcxx_check_bucket_index(__b);
933 end(size_type __b)
const
935 __glibcxx_check_bucket_index(__b);
940 cbegin(size_type __b)
const
942 __glibcxx_check_bucket_index(__b);
947 cend(size_type __b)
const
949 __glibcxx_check_bucket_index(__b);
954 bucket_size(size_type __b)
const
956 __glibcxx_check_bucket_index(__b);
957 return _Base::bucket_size(__b);
961 max_load_factor()
const noexcept
962 {
return _Base::max_load_factor(); }
965 max_load_factor(
float __f)
967 __glibcxx_check_max_load_factor(__f);
968 _Base::max_load_factor(__f);
971 template<
typename... _Args>
973 emplace(_Args&&... __args)
975 size_type __bucket_count = this->bucket_count();
977 = _Base::emplace(std::forward<_Args>(__args)...);
978 _M_check_rehashed(__bucket_count);
982 template<
typename... _Args>
987 size_type __bucket_count = this->bucket_count();
988 _Base_iterator __it = _Base::emplace_hint(__hint.
base(),
989 std::forward<_Args>(__args)...);
990 _M_check_rehashed(__bucket_count);
995 insert(
const value_type& __obj)
997 size_type __bucket_count = this->bucket_count();
998 _Base_iterator __it = _Base::insert(__obj);
999 _M_check_rehashed(__bucket_count);
1006 insert(value_type&& __x)
1008 size_type __bucket_count = this->bucket_count();
1009 auto __it = _Base::insert(std::move(__x));
1010 _M_check_rehashed(__bucket_count);
1011 return { __it,
this };
1018 size_type __bucket_count = this->bucket_count();
1019 _Base_iterator __it = _Base::insert(__hint.
base(), __obj);
1020 _M_check_rehashed(__bucket_count);
1030 size_type __bucket_count = this->bucket_count();
1031 auto __it = _Base::insert(__hint.
base(), std::move(__x));
1032 _M_check_rehashed(__bucket_count);
1036 template<
typename _Pair,
typename =
typename
1038 _Pair&&>::value>::type>
1040 insert(_Pair&& __obj)
1042 size_type __bucket_count = this->bucket_count();
1043 _Base_iterator __it = _Base::insert(std::forward<_Pair>(__obj));
1044 _M_check_rehashed(__bucket_count);
1048 template<
typename _Pair,
typename =
typename
1050 _Pair&&>::value>::type>
1055 size_type __bucket_count = this->bucket_count();
1056 _Base_iterator __it =
1057 _Base::insert(__hint.
base(), std::forward<_Pair>(__obj));
1058 _M_check_rehashed(__bucket_count);
1064 { _Base::insert(__l); }
1066 template<
typename _InputIterator>
1068 insert(_InputIterator __first, _InputIterator __last)
1071 __glibcxx_check_valid_range2(__first, __last, __dist);
1072 size_type __bucket_count = this->bucket_count();
1074 if (__dist.
second >= __gnu_debug::__dp_sign)
1075 _Base::insert(__gnu_debug::__unsafe(__first),
1076 __gnu_debug::__unsafe(__last));
1078 _Base::insert(__first, __last);
1080 _M_check_rehashed(__bucket_count);
1083 #if __cplusplus > 201402L
1084 using node_type =
typename _Base::node_type;
1090 _Base_const_iterator __victim = __position.
base();
1092 [__victim](_Base_const_iterator __it) {
return __it == __victim; }
1095 [__victim](_Base_const_local_iterator __it) {
1096 return __it._M_curr() == __victim._M_cur;
1098 return _Base::extract(__position.
base());
1102 extract(
const key_type& __key)
1104 const auto __position = find(__key);
1105 if (__position != end())
1106 return extract(__position);
1111 insert(node_type&& __nh)
1112 {
return iterator(_Base::insert(std::move(__nh)),
this); }
1118 return iterator(_Base::insert(__hint.
base(), std::move(__nh)),
this);
1125 find(
const key_type& __key)
1126 {
return iterator(_Base::find(__key),
this); }
1129 find(
const key_type& __key)
const
1133 equal_range(
const key_type& __key)
1136 _Base::equal_range(__key);
1142 equal_range(
const key_type& __key)
const
1145 _Base::equal_range(__key);
1151 erase(
const key_type& __key)
1154 size_type __bucket_count = this->bucket_count();
1156 _Base::equal_range(__key);
1157 for (_Base_iterator __victim = __pair.
first; __victim != __pair.
second;)
1160 {
return __it == __victim; });
1162 [__victim](_Base_const_local_iterator __it)
1163 {
return __it._M_curr() == __victim._M_cur; });
1164 _Base::erase(__victim++);
1167 _M_check_rehashed(__bucket_count);
1175 _Base_const_iterator __victim = __it.
base();
1177 {
return __it == __victim; });
1179 [__victim](_Base_const_local_iterator __it)
1180 {
return __it._M_curr() == __victim._M_cur; });
1181 size_type __bucket_count = this->bucket_count();
1182 _Base_iterator __next = _Base::erase(__it.base());
1183 _M_check_rehashed(__bucket_count);
1195 for (_Base_const_iterator __tmp = __first.
base();
1196 __tmp != __last.
base(); ++__tmp)
1198 _GLIBCXX_DEBUG_VERIFY(__tmp != _Base::end(),
1199 _M_message(__gnu_debug::__msg_valid_range)
1200 ._M_iterator(__first,
"first")
1201 ._M_iterator(__last,
"last"));
1203 {
return __it == __tmp; });
1205 [__tmp](_Base_const_local_iterator __it)
1206 {
return __it._M_curr() == __tmp._M_cur; });
1208 size_type __bucket_count = this->bucket_count();
1209 _Base_iterator __next = _Base::erase(__first.
base(), __last.
base());
1210 _M_check_rehashed(__bucket_count);
1215 _M_base() noexcept {
return *
this; }
1218 _M_base()
const noexcept {
return *
this; }
1222 _M_check_rehashed(size_type __prev_count)
1224 if (__prev_count != this->bucket_count())
1225 this->_M_invalidate_locals();
1229 #if __cpp_deduction_guides >= 201606
1231 template<
typename _InputIterator,
1235 typename = _RequireInputIter<_InputIterator>,
1236 typename = _RequireAllocator<_Allocator>>
1238 unordered_multimap<int, int>::size_type = {},
1239 _Hash = _Hash(), _Pred = _Pred(),
1240 _Allocator = _Allocator())
1242 __iter_val_t<_InputIterator>, _Hash, _Pred,
1245 template<
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
1246 typename _Pred = equal_to<_Key>,
1247 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1248 typename = _RequireAllocator<_Allocator>>
1251 _Hash = _Hash(), _Pred = _Pred(),
1252 _Allocator = _Allocator())
1253 -> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Allocator>;
1255 template<
typename _InputIterator,
typename _Allocator,
1256 typename = _RequireInputIter<_InputIterator>,
1257 typename = _RequireAllocator<_Allocator>>
1258 unordered_multimap(_InputIterator, _InputIterator,
1259 unordered_multimap<int, int>::size_type, _Allocator)
1260 -> unordered_multimap<__iter_key_t<_InputIterator>,
1261 __iter_val_t<_InputIterator>,
1262 hash<__iter_key_t<_InputIterator>>,
1263 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1265 template<
typename _InputIterator,
typename _Allocator,
1266 typename = _RequireInputIter<_InputIterator>,
1267 typename = _RequireAllocator<_Allocator>>
1268 unordered_multimap(_InputIterator, _InputIterator, _Allocator)
1269 -> unordered_multimap<__iter_key_t<_InputIterator>,
1270 __iter_val_t<_InputIterator>,
1271 hash<__iter_key_t<_InputIterator>>,
1272 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1274 template<
typename _InputIterator,
typename _Hash,
typename _Allocator,
1275 typename = _RequireInputIter<_InputIterator>,
1276 typename = _RequireAllocator<_Allocator>>
1277 unordered_multimap(_InputIterator, _InputIterator,
1278 unordered_multimap<int, int>::size_type, _Hash,
1280 -> unordered_multimap<__iter_key_t<_InputIterator>,
1281 __iter_val_t<_InputIterator>, _Hash,
1282 equal_to<__iter_key_t<_InputIterator>>, _Allocator>;
1284 template<
typename _Key,
typename _Tp,
typename _Allocator,
1285 typename = _RequireAllocator<_Allocator>>
1286 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
1287 unordered_multimap<int, int>::size_type,
1289 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1291 template<
typename _Key,
typename _Tp,
typename _Allocator,
1292 typename = _RequireAllocator<_Allocator>>
1293 unordered_multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
1294 -> unordered_multimap<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
1296 template<
typename _Key,
typename _Tp,
typename _Hash,
typename _Allocator,
1297 typename = _RequireAllocator<_Allocator>>
1298 unordered_multimap(initializer_list<pair<_Key, _Tp>>,
1299 unordered_multimap<int, int>::size_type,
1301 -> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
1305 template<
typename _Key,
typename _Tp,
typename _Hash,
1306 typename _Pred,
typename _Alloc>
1308 swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
1309 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
1310 noexcept(noexcept(__x.swap(__y)))
1313 template<
typename _Key,
typename _Tp,
typename _Hash,
1314 typename _Pred,
typename _Alloc>
1316 operator==(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
1317 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
1318 {
return __x._M_base() == __y._M_base(); }
1320 template<
typename _Key,
typename _Tp,
typename _Hash,
1321 typename _Pred,
typename _Alloc>
1323 operator!=(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
1324 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
1325 {
return !(__x == __y); }
_Hashtable::size_type size_type
Iterator-related typedefs.
A standard container composed of unique keys (containing at most one of each key value) that associat...
_Hashtable::size_type size_type
Iterator-related typedefs.
Safe class dealing with some allocator dependent operations.
_Iterator & base() noexcept
Return the underlying iterator.
Base class that supports tracking of iterators that reference a sequence.
constexpr pair< typename __decay_and_strip< _T1 >::__type, typename __decay_and_strip< _T2 >::__type > make_pair(_T1 &&__x, _T2 &&__y)
A convenience wrapper for creating a pair from two objects.
Struct holding two objects of arbitrary type.
Class std::unordered_multimap with safety/checking/debug instrumentation.
The standard allocator, as per [20.4].
Define a member typedef type only if a boolean constant is true.
void _M_invalidate_local_if(_Predicate __pred)
_T2 second
first is a copy of the first object
Primary class template hash.
void _M_invalidate_if(_Predicate __pred)
Class std::unordered_map with safety/checking/debug instrumentation.
#define __glibcxx_check_erase_range(_First, _Last)
#define __glibcxx_check_insert(_Position)
A standard container composed of equivalent keys (possibly containing multiple of each key value) tha...
One of the comparison functors.
#define __glibcxx_check_erase(_Position)
Base class for constructing a safe unordered container type that tracks iterators that reference it...
_T1 first
second_type is the second bound type