30 #ifndef _GLIBCXX_DEBUG_SET_H
31 #define _GLIBCXX_DEBUG_SET_H 1
37 namespace std _GLIBCXX_VISIBILITY(default)
42 template<
typename _Key,
typename _Compare = std::less<_Key>,
43 typename _Allocator = std::allocator<_Key> >
48 typedef _GLIBCXX_STD_C::set<_Key, _Compare, _Allocator>
_Base;
56 typedef _Key key_type;
57 typedef _Key value_type;
58 typedef _Compare key_compare;
59 typedef _Compare value_compare;
60 typedef _Allocator allocator_type;
61 typedef typename _Base::reference reference;
62 typedef typename _Base::const_reference const_reference;
69 typedef typename _Base::size_type size_type;
70 typedef typename _Base::difference_type difference_type;
71 typedef typename _Base::pointer pointer;
72 typedef typename _Base::const_pointer const_pointer;
77 explicit set(
const _Compare& __comp = _Compare(),
78 const _Allocator& __a = _Allocator())
79 :
_Base(__comp, __a) { }
81 template<
typename _InputIterator>
82 set(_InputIterator __first, _InputIterator __last,
83 const _Compare& __comp = _Compare(),
84 const _Allocator& __a = _Allocator())
96 #ifdef __GXX_EXPERIMENTAL_CXX0X__
102 const _Compare& __comp = _Compare(),
103 const allocator_type& __a = allocator_type())
110 operator=(
const set& __x)
112 *
static_cast<_Base*
>(
this) = __x;
113 this->_M_invalidate_all();
117 #ifdef __GXX_EXPERIMENTAL_CXX0X__
137 using _Base::get_allocator;
142 {
return iterator(_Base::begin(),
this); }
150 {
return iterator(_Base::end(),
this); }
172 #ifdef __GXX_EXPERIMENTAL_CXX0X__
193 using _Base::max_size;
197 insert(
const value_type& __x)
204 #ifdef __GXX_EXPERIMENTAL_CXX0X__
206 insert(value_type&& __x)
210 = _Base::insert(std::move(__x));
220 return iterator(_Base::insert(__position.
base(), __x),
this);
223 #ifdef __GXX_EXPERIMENTAL_CXX0X__
228 return iterator(_Base::insert(__position.
base(), std::move(__x)),
233 template <
typename _InputIterator>
235 insert(_InputIterator __first, _InputIterator __last)
237 __glibcxx_check_valid_range(__first, __last);
242 #ifdef __GXX_EXPERIMENTAL_CXX0X__
245 { _Base::insert(__l); }
248 #ifdef __GXX_EXPERIMENTAL_CXX0X__
262 _Base::erase(__position.
base());
267 erase(
const key_type& __x)
270 if (__victim == _Base::end())
275 _Base::erase(__victim);
280 #ifdef __GXX_EXPERIMENTAL_CXX0X__
288 __victim != __last.
base(); ++__victim)
291 _M_message(__gnu_debug::__msg_valid_range)
292 ._M_iterator(__first,
"first")
293 ._M_iterator(__last,
"last"));
306 __victim != __last.
base(); ++__victim)
309 _M_message(__gnu_debug::__msg_valid_range)
310 ._M_iterator(__first,
"first")
311 ._M_iterator(__last,
"last"));
314 _Base::erase(__first.
base(), __last.
base());
328 this->_M_invalidate_all();
333 using _Base::key_comp;
334 using _Base::value_comp;
338 find(
const key_type& __x)
339 {
return iterator(_Base::find(__x),
this); }
344 find(
const key_type& __x)
const
350 lower_bound(
const key_type& __x)
351 {
return iterator(_Base::lower_bound(__x),
this); }
356 lower_bound(
const key_type& __x)
const
360 upper_bound(
const key_type& __x)
361 {
return iterator(_Base::upper_bound(__x),
this); }
366 upper_bound(
const key_type& __x)
const
370 equal_range(
const key_type& __x)
373 _Base::equal_range(__x);
381 equal_range(
const key_type& __x)
const
384 _Base::equal_range(__x);
390 _M_base() {
return *
this; }
393 _M_base()
const {
return *
this; }
404 template<
typename _Key,
typename _Compare,
typename _Allocator>
408 {
return __lhs._M_base() == __rhs._M_base(); }
410 template<
typename _Key,
typename _Compare,
typename _Allocator>
414 {
return __lhs._M_base() != __rhs._M_base(); }
416 template<
typename _Key,
typename _Compare,
typename _Allocator>
418 operator<(const set<_Key, _Compare, _Allocator>& __lhs,
419 const set<_Key, _Compare, _Allocator>& __rhs)
420 {
return __lhs._M_base() < __rhs._M_base(); }
422 template<
typename _Key,
typename _Compare,
typename _Allocator>
424 operator<=(const set<_Key, _Compare, _Allocator>& __lhs,
425 const set<_Key, _Compare, _Allocator>& __rhs)
426 {
return __lhs._M_base() <= __rhs._M_base(); }
428 template<
typename _Key,
typename _Compare,
typename _Allocator>
430 operator>=(
const set<_Key, _Compare, _Allocator>& __lhs,
431 const set<_Key, _Compare, _Allocator>& __rhs)
432 {
return __lhs._M_base() >= __rhs._M_base(); }
434 template<
typename _Key,
typename _Compare,
typename _Allocator>
436 operator>(
const set<_Key, _Compare, _Allocator>& __lhs,
437 const set<_Key, _Compare, _Allocator>& __rhs)
438 {
return __lhs._M_base() > __rhs._M_base(); }
440 template<
typename _Key,
typename _Compare,
typename _Allocator>
442 swap(set<_Key, _Compare, _Allocator>& __x,
443 set<_Key, _Compare, _Allocator>& __y)
444 {
return __x.swap(__y); }