libstdc++
set.h
Go to the documentation of this file.
1// Debugging set implementation -*- C++ -*-
2
3// Copyright (C) 2003-2026 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file debug/set.h
26 * This file is a GNU debug extension to the Standard C++ Library.
27 */
28
29#ifndef _GLIBCXX_DEBUG_SET_H
30#define _GLIBCXX_DEBUG_SET_H 1
31
32#include <debug/safe_sequence.h>
34#include <debug/safe_iterator.h>
35#include <bits/stl_pair.h>
36
37namespace std _GLIBCXX_VISIBILITY(default)
38{
39namespace __debug
40{
41 /// Class std::set with safety/checking/debug instrumentation.
42 template<typename _Key, typename _Compare = std::less<_Key>,
43 typename _Allocator = std::allocator<_Key> >
44 class set
46 set<_Key, _Compare, _Allocator>, _Allocator,
47 __gnu_debug::_Safe_node_sequence>,
48 public _GLIBCXX_STD_C::set<_Key,_Compare,_Allocator>
49 {
50 typedef _GLIBCXX_STD_C::set<_Key, _Compare, _Allocator> _Base;
52 set, _Allocator, __gnu_debug::_Safe_node_sequence> _Safe;
53
54 typedef typename _Base::const_iterator _Base_const_iterator;
55 typedef typename _Base::iterator _Base_iterator;
57
58 template<typename _ItT, typename _SeqT, typename _CatT>
59 friend class ::__gnu_debug::_Safe_iterator;
60
61 // Reference wrapper for base class. Disambiguates set(const _Base&)
62 // from copy constructor by requiring a user-defined conversion.
63 // See PR libstdc++/90102.
64 struct _Base_ref
65 {
66 _Base_ref(const _Base& __r) : _M_ref(__r) { }
67
68 const _Base& _M_ref;
69 };
70
71 public:
72 // types:
73 typedef _Key key_type;
74 typedef _Key value_type;
75 typedef _Compare key_compare;
76 typedef _Compare value_compare;
77 typedef _Allocator allocator_type;
78 typedef typename _Base::reference reference;
79 typedef typename _Base::const_reference const_reference;
80
82 iterator;
84 const_iterator;
85
86 typedef typename _Base::size_type size_type;
87 typedef typename _Base::difference_type difference_type;
88 typedef typename _Base::pointer pointer;
89 typedef typename _Base::const_pointer const_pointer;
90 typedef std::reverse_iterator<iterator> reverse_iterator;
91 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
92
93 // 23.3.3.1 construct/copy/destroy:
94
95#if __cplusplus < 201103L
96 set() : _Base() { }
97
98 set(const set& __x)
99 : _Base(__x) { }
100
101 ~set() { }
102#else
103 set() = default;
104 set(const set&) = default;
105 set(set&&) = default;
106
108 const _Compare& __comp = _Compare(),
109 const allocator_type& __a = allocator_type())
110 : _Base(__l, __comp, __a) { }
111
112 explicit
113 set(const allocator_type& __a)
114 : _Base(__a) { }
115
116 set(const set& __x, const __type_identity_t<allocator_type>& __a)
117 : _Base(__x, __a) { }
118
119 set(set&& __x, const __type_identity_t<allocator_type>& __a)
120 noexcept( noexcept(_Base(std::move(__x), __a)) )
121 : _Safe(std::move(__x), __a),
122 _Base(std::move(__x), __a) { }
123
124 set(initializer_list<value_type> __l, const allocator_type& __a)
125 : _Base(__l, __a) { }
126
127 template<typename _InputIterator>
128 set(_InputIterator __first, _InputIterator __last,
129 const allocator_type& __a)
130 : _Base(__gnu_debug::__base(
131 __glibcxx_check_valid_constructor_range(__first, __last)),
132 __gnu_debug::__base(__last), __a) { }
133
134#if __glibcxx_containers_ranges // C++ >= 23
135 /**
136 * @brief Construct a set from a range.
137 * @since C++23
138 */
139 template<std::__detail::__container_compatible_range<_Key> _Rg>
140 set(std::from_range_t __t, _Rg&& __rg,
141 const _Compare& __c,
142 const allocator_type& __a = allocator_type())
143 : _Base(__t, std::forward<_Rg>(__rg), __c, __a)
144 { }
145
146 template<std::__detail::__container_compatible_range<_Key> _Rg>
147 set(std::from_range_t __t, _Rg&& __rg,
148 const allocator_type& __a = allocator_type())
149 : _Base(__t, std::forward<_Rg>(__rg), __a)
150 { }
151#endif
152
153 ~set() = default;
154#endif
155
156 explicit set(const _Compare& __comp,
157 const _Allocator& __a = _Allocator())
158 : _Base(__comp, __a) { }
159
160 template<typename _InputIterator>
161 set(_InputIterator __first, _InputIterator __last,
162 const _Compare& __comp = _Compare(),
163 const _Allocator& __a = _Allocator())
164 : _Base(__gnu_debug::__base(
165 __glibcxx_check_valid_constructor_range(__first, __last)),
166 __gnu_debug::__base(__last),
167 __comp, __a) { }
168
169 set(_Base_ref __x)
170 : _Base(__x._M_ref) { }
171
172#if __cplusplus >= 201103L
173 set&
174 operator=(const set&) = default;
175
176 set&
177 operator=(set&&) = default;
178
179 set&
180 operator=(initializer_list<value_type> __l)
181 {
182 _Base::operator=(__l);
183 this->_M_invalidate_all();
184 return *this;
185 }
186#endif
187
188 using _Base::get_allocator;
189
190 // iterators:
191 iterator
192 begin() _GLIBCXX_NOEXCEPT
193 { return iterator(_Base::begin(), this); }
194
195 const_iterator
196 begin() const _GLIBCXX_NOEXCEPT
197 { return const_iterator(_Base::begin(), this); }
198
199 iterator
200 end() _GLIBCXX_NOEXCEPT
201 { return iterator(_Base::end(), this); }
202
203 const_iterator
204 end() const _GLIBCXX_NOEXCEPT
205 { return const_iterator(_Base::end(), this); }
206
207 reverse_iterator
208 rbegin() _GLIBCXX_NOEXCEPT
209 { return reverse_iterator(end()); }
210
211 const_reverse_iterator
212 rbegin() const _GLIBCXX_NOEXCEPT
213 { return const_reverse_iterator(end()); }
214
215 reverse_iterator
216 rend() _GLIBCXX_NOEXCEPT
217 { return reverse_iterator(begin()); }
218
219 const_reverse_iterator
220 rend() const _GLIBCXX_NOEXCEPT
221 { return const_reverse_iterator(begin()); }
222
223#if __cplusplus >= 201103L
224 const_iterator
225 cbegin() const noexcept
226 { return const_iterator(_Base::begin(), this); }
227
228 const_iterator
229 cend() const noexcept
230 { return const_iterator(_Base::end(), this); }
231
232 const_reverse_iterator
233 crbegin() const noexcept
234 { return const_reverse_iterator(end()); }
235
236 const_reverse_iterator
237 crend() const noexcept
238 { return const_reverse_iterator(begin()); }
239#endif
240
241 // capacity:
242 using _Base::empty;
243 using _Base::size;
244 using _Base::max_size;
245
246 // modifiers:
247#if __cplusplus >= 201103L
248 template<typename... _Args>
250 emplace(_Args&&... __args)
251 {
252 auto __res = _Base::emplace(std::forward<_Args>(__args)...);
253 return { { __res.first, this }, __res.second };
254 }
255
256 template<typename... _Args>
257 iterator
258 emplace_hint(const_iterator __pos, _Args&&... __args)
259 {
261 return
262 {
263 _Base::emplace_hint(__pos.base(), std::forward<_Args>(__args)...),
264 this
265 };
266 }
267#endif
268
270 insert(const value_type& __x)
271 {
272 std::pair<_Base_iterator, bool> __res = _Base::insert(__x);
273 return std::pair<iterator, bool>(iterator(__res.first, this),
274 __res.second);
275 }
276
277#if __cplusplus >= 201103L
279 insert(value_type&& __x)
280 {
281 auto __res = _Base::insert(std::move(__x));
282 return { { __res.first, this }, __res.second };
283 }
284#endif
285
286 iterator
287 insert(const_iterator __position, const value_type& __x)
288 {
289 __glibcxx_check_insert(__position);
290 return iterator(_Base::insert(__position.base(), __x), this);
291 }
292
293#if __cplusplus >= 201103L
294 iterator
295 insert(const_iterator __position, value_type&& __x)
296 {
297 __glibcxx_check_insert(__position);
298 return { _Base::insert(__position.base(), std::move(__x)), this };
299 }
300#endif
301
302 template <typename _InputIterator>
303 void
304 insert(_InputIterator __first, _InputIterator __last)
305 {
306 typename __gnu_debug::_Distance_traits<_InputIterator>::__type __dist;
307 __glibcxx_check_valid_range2(__first, __last, __dist);
308
309 if (__dist.second >= __gnu_debug::__dp_sign)
310 _Base::insert(__gnu_debug::__unsafe(__first),
311 __gnu_debug::__unsafe(__last));
312 else
313 _Base::insert(__first, __last);
314 }
315
316#if __cplusplus >= 201103L
317 void
319 { _Base::insert(__l); }
320#endif
321
322#ifdef __glibcxx_node_extract // >= C++17 && HOSTED
323 using node_type = typename _Base::node_type;
324 using insert_return_type = _Node_insert_return<iterator, node_type>;
325
326 node_type
327 extract(const_iterator __position)
328 {
329 __glibcxx_check_erase(__position);
330 this->_M_invalidate_if(_Equal(__position.base()));
331 return _Base::extract(__position.base());
332 }
333
334 node_type
335 extract(const key_type& __key)
336 {
337 const auto __position = find(__key);
338 if (__position != end())
339 return extract(__position);
340 return {};
341 }
342
343# ifdef __glibcxx_associative_heterogeneous_erasure
344 template <__heterogeneous_tree_key<set> _Kt>
345 node_type
346 extract(_Kt&& __key)
347 {
348 const auto __position = find(__key);
349 if (__position != end())
350 return extract(__position);
351 return {};
352 }
353#endif
354
355 insert_return_type
356 insert(node_type&& __nh)
357 {
358 auto __ret = _Base::insert(std::move(__nh));
359 iterator __pos = iterator(__ret.position, this);
360 return { __pos, __ret.inserted, std::move(__ret.node) };
361 }
362
363 iterator
364 insert(const_iterator __hint, node_type&& __nh)
365 {
367 return { _Base::insert(__hint.base(), std::move(__nh)), this };
368 }
369
370 using _Base::merge;
371#endif // C++17
372
373#if __cplusplus >= 201103L
374 _GLIBCXX_ABI_TAG_CXX11
375 iterator
376 erase(const_iterator __position)
377 {
378 __glibcxx_check_erase(__position);
379 return { erase(__position.base()), this };
380 }
381
382 _Base_iterator
383 erase(_Base_const_iterator __position)
384 {
385 __glibcxx_check_erase2(__position);
386 this->_M_invalidate_if(_Equal(__position));
387 return _Base::erase(__position);
388 }
389#else
390 void
391 erase(iterator __position)
392 {
393 __glibcxx_check_erase(__position);
394 this->_M_invalidate_if(_Equal(__position.base()));
395 _Base::erase(__position.base());
396 }
397#endif
398
399 size_type
400 erase(const key_type& __x)
401 {
402 _Base_iterator __victim = _Base::find(__x);
403 if (__victim == _Base::end())
404 return 0;
405 else
406 {
407 this->_M_invalidate_if(_Equal(__victim));
408 _Base::erase(__victim);
409 return 1;
410 }
411 }
412
413# ifdef __glibcxx_associative_heterogeneous_erasure
414 // Note that for some types _Kt this may erase more than
415 // one element, such as if _Kt::operator< checks only part
416 // of the key.
417 template <__heterogeneous_tree_key<set> _Kt>
418 size_type
419 erase(_Kt&& __x)
420 {
421 auto __victims = _Base::equal_range(__x);
422 size_type __count = 0;
423 for (auto __victim = __victims.first; __victim != __victims.second;)
424 {
425 this->_M_invalidate_if(_Equal(__victim));
426 _Base::erase(__victim++);
427 ++__count;
428 }
429 return __count;
430 }
431#endif
432
433#if __cplusplus >= 201103L
434 _GLIBCXX_ABI_TAG_CXX11
435 iterator
436 erase(const_iterator __first, const_iterator __last)
437 {
438 // _GLIBCXX_RESOLVE_LIB_DEFECTS
439 // 151. can't currently clear() empty container
440 __glibcxx_check_erase_range(__first, __last);
441 for (_Base_const_iterator __victim = __first.base();
442 __victim != __last.base(); ++__victim)
443 {
444 _GLIBCXX_DEBUG_VERIFY(__victim != _Base::cend(),
445 _M_message(__gnu_debug::__msg_valid_range)
446 ._M_iterator(__first, "first")
447 ._M_iterator(__last, "last"));
448 this->_M_invalidate_if(_Equal(__victim));
449 }
450
451 return { _Base::erase(__first.base(), __last.base()), this };
452 }
453#else
454 void
455 erase(iterator __first, iterator __last)
456 {
457 // _GLIBCXX_RESOLVE_LIB_DEFECTS
458 // 151. can't currently clear() empty container
459 __glibcxx_check_erase_range(__first, __last);
460 for (_Base_iterator __victim = __first.base();
461 __victim != __last.base(); ++__victim)
462 {
463 _GLIBCXX_DEBUG_VERIFY(__victim != _Base::end(),
464 _M_message(__gnu_debug::__msg_valid_range)
465 ._M_iterator(__first, "first")
466 ._M_iterator(__last, "last"));
467 this->_M_invalidate_if(_Equal(__victim));
468 }
469 _Base::erase(__first.base(), __last.base());
470 }
471#endif
472
473 void
474 swap(set& __x)
475 _GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
476 {
477 _Safe::_M_swap(__x);
478 _Base::swap(__x);
479 }
480
481 void
482 clear() _GLIBCXX_NOEXCEPT
483 {
484 this->_M_invalidate_all();
485 _Base::clear();
486 }
487
488 // observers:
489 using _Base::key_comp;
490 using _Base::value_comp;
491
492 // set operations:
493 iterator
494 find(const key_type& __x)
495 { return iterator(_Base::find(__x), this); }
496
497 // _GLIBCXX_RESOLVE_LIB_DEFECTS
498 // 214. set::find() missing const overload
499 const_iterator
500 find(const key_type& __x) const
501 { return const_iterator(_Base::find(__x), this); }
502
503#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
504 template<typename _Kt,
505 typename _Req =
506 typename __has_is_transparent<_Compare, _Kt>::type>
507 iterator
508 find(const _Kt& __x)
509 { return { _Base::find(__x), this }; }
510
511 template<typename _Kt,
512 typename _Req =
513 typename __has_is_transparent<_Compare, _Kt>::type>
514 const_iterator
515 find(const _Kt& __x) const
516 { return { _Base::find(__x), this }; }
517#endif
518
519 using _Base::count;
520
521 iterator
522 lower_bound(const key_type& __x)
523 { return iterator(_Base::lower_bound(__x), this); }
524
525 // _GLIBCXX_RESOLVE_LIB_DEFECTS
526 // 214. set::find() missing const overload
527 const_iterator
528 lower_bound(const key_type& __x) const
529 { return const_iterator(_Base::lower_bound(__x), this); }
530
531#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
532 template<typename _Kt,
533 typename _Req =
534 typename __has_is_transparent<_Compare, _Kt>::type>
535 iterator
536 lower_bound(const _Kt& __x)
537 { return { _Base::lower_bound(__x), this }; }
538
539 template<typename _Kt,
540 typename _Req =
541 typename __has_is_transparent<_Compare, _Kt>::type>
542 const_iterator
543 lower_bound(const _Kt& __x) const
544 { return { _Base::lower_bound(__x), this }; }
545#endif
546
547 iterator
548 upper_bound(const key_type& __x)
549 { return iterator(_Base::upper_bound(__x), this); }
550
551 // _GLIBCXX_RESOLVE_LIB_DEFECTS
552 // 214. set::find() missing const overload
553 const_iterator
554 upper_bound(const key_type& __x) const
555 { return const_iterator(_Base::upper_bound(__x), this); }
556
557#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
558 template<typename _Kt,
559 typename _Req =
560 typename __has_is_transparent<_Compare, _Kt>::type>
561 iterator
562 upper_bound(const _Kt& __x)
563 { return { _Base::upper_bound(__x), this }; }
564
565 template<typename _Kt,
566 typename _Req =
567 typename __has_is_transparent<_Compare, _Kt>::type>
568 const_iterator
569 upper_bound(const _Kt& __x) const
570 { return { _Base::upper_bound(__x), this }; }
571#endif
572
574 equal_range(const key_type& __x)
575 {
577 _Base::equal_range(__x);
578 return std::make_pair(iterator(__res.first, this),
579 iterator(__res.second, this));
580 }
581
582 // _GLIBCXX_RESOLVE_LIB_DEFECTS
583 // 214. set::find() missing const overload
585 equal_range(const key_type& __x) const
586 {
588 _Base::equal_range(__x);
589 return std::make_pair(const_iterator(__res.first, this),
590 const_iterator(__res.second, this));
591 }
592
593#ifdef __glibcxx_generic_associative_lookup // C++ >= 14
594 template<typename _Kt,
595 typename _Req =
596 typename __has_is_transparent<_Compare, _Kt>::type>
598 equal_range(const _Kt& __x)
599 {
600 auto __res = _Base::equal_range(__x);
601 return { { __res.first, this }, { __res.second, this } };
602 }
603
604 template<typename _Kt,
605 typename _Req =
606 typename __has_is_transparent<_Compare, _Kt>::type>
608 equal_range(const _Kt& __x) const
609 {
610 auto __res = _Base::equal_range(__x);
611 return { { __res.first, this }, { __res.second, this } };
612 }
613#endif
614
615 _Base&
616 _M_base() _GLIBCXX_NOEXCEPT { return *this; }
617
618 const _Base&
619 _M_base() const _GLIBCXX_NOEXCEPT { return *this; }
620 };
621
622#if __cpp_deduction_guides >= 201606
623
624 template<typename _InputIterator,
625 typename _Compare =
627 typename _Allocator =
629 typename = _RequireInputIter<_InputIterator>,
630 typename = _RequireNotAllocator<_Compare>,
631 typename = _RequireAllocator<_Allocator>>
632 set(_InputIterator, _InputIterator,
633 _Compare = _Compare(), _Allocator = _Allocator())
635 _Compare, _Allocator>;
636
637 template<typename _Key, typename _Compare = less<_Key>,
638 typename _Allocator = allocator<_Key>,
639 typename = _RequireNotAllocator<_Compare>,
640 typename = _RequireAllocator<_Allocator>>
642 _Compare = _Compare(), _Allocator = _Allocator())
644
645 template<typename _InputIterator, typename _Allocator,
646 typename = _RequireInputIter<_InputIterator>,
647 typename = _RequireAllocator<_Allocator>>
648 set(_InputIterator, _InputIterator, _Allocator)
651 _Allocator>;
652
653 template<typename _Key, typename _Allocator,
654 typename = _RequireAllocator<_Allocator>>
655 set(initializer_list<_Key>, _Allocator)
656 -> set<_Key, less<_Key>, _Allocator>;
657
658#if __glibcxx_containers_ranges // C++ >= 23
659 template<ranges::input_range _Rg,
660 __not_allocator_like _Compare = less<ranges::range_value_t<_Rg>>,
661 __allocator_like _Alloc = std::allocator<ranges::range_value_t<_Rg>>>
662 set(from_range_t, _Rg&&, _Compare = _Compare(), _Alloc = _Alloc())
663 -> set<ranges::range_value_t<_Rg>, _Compare, _Alloc>;
664
665 template<ranges::input_range _Rg, __allocator_like _Alloc>
666 set(from_range_t, _Rg&&, _Alloc)
668#endif
669#endif // deduction guides
670
671 template<typename _Key, typename _Compare, typename _Allocator>
672 inline bool
673 operator==(const set<_Key, _Compare, _Allocator>& __lhs,
675 { return __lhs._M_base() == __rhs._M_base(); }
676
677#if __cpp_lib_three_way_comparison
678 template<typename _Key, typename _Compare, typename _Alloc>
679 inline __detail::__synth3way_t<_Key>
680 operator<=>(const set<_Key, _Compare, _Alloc>& __lhs,
681 const set<_Key, _Compare, _Alloc>& __rhs)
682 { return __lhs._M_base() <=> __rhs._M_base(); }
683#else
684 template<typename _Key, typename _Compare, typename _Allocator>
685 inline bool
686 operator!=(const set<_Key, _Compare, _Allocator>& __lhs,
687 const set<_Key, _Compare, _Allocator>& __rhs)
688 { return __lhs._M_base() != __rhs._M_base(); }
689
690 template<typename _Key, typename _Compare, typename _Allocator>
691 inline bool
694 { return __lhs._M_base() < __rhs._M_base(); }
695
696 template<typename _Key, typename _Compare, typename _Allocator>
697 inline bool
700 { return __lhs._M_base() <= __rhs._M_base(); }
701
702 template<typename _Key, typename _Compare, typename _Allocator>
703 inline bool
706 { return __lhs._M_base() >= __rhs._M_base(); }
707
708 template<typename _Key, typename _Compare, typename _Allocator>
709 inline bool
712 { return __lhs._M_base() > __rhs._M_base(); }
713#endif // three-way comparison
714
715 template<typename _Key, typename _Compare, typename _Allocator>
716 void
719 _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))
720 { return __x.swap(__y); }
721
722} // namespace __debug
723} // namespace std
724
725#endif
#define __glibcxx_check_insert(_Position)
Definition macros.h:143
#define __glibcxx_check_erase_range(_First, _Last)
Definition macros.h:245
#define __glibcxx_check_erase(_Position)
Definition macros.h:209
constexpr bool operator<=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
Definition chrono.h:859
constexpr bool operator>=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
Definition chrono.h:873
constexpr bool operator<(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
Definition chrono.h:826
constexpr bool operator>(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
Definition chrono.h:866
pair(_T1, _T2) -> pair< _T1, _T2 >
Two pairs are equal iff their members are equal.
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.
Definition stl_pair.h:1166
auto declval() noexcept -> decltype(__declval< _Tp >(0))
Definition type_traits:2714
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
Definition move.h:138
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
Definition move.h:72
ISO C++ entities toplevel namespace is std.
constexpr _Iterator __base(_Iterator __it)
GNU debug code, replaces standard behavior with debug behavior.
initializer_list
The standard allocator, as per C++03 [20.4.1].
Definition allocator.h:134
Safe iterator wrapper.
constexpr _Iterator & base() noexcept
Return the underlying iterator.
One of the comparison functors.
Struct holding two objects of arbitrary type.
Definition stl_pair.h:304
_T1 first
The first member.
Definition stl_pair.h:308
_T2 second
The second member.
Definition stl_pair.h:309
A standard container made up of unique keys, which can be retrieved in logarithmic time.
Definition stl_set.h:101
Safe class dealing with some allocator dependent operations.
Like _Safe_sequence but with a special _M_invalidate_all implementation not invalidating past-the-end...
Class std::set with safety/checking/debug instrumentation.
Definition set.h:49
A range for which ranges::begin returns an input iterator.