30 #ifndef _GLIBCXX_DEBUG_UNORDERED_SET
31 #define _GLIBCXX_DEBUG_UNORDERED_SET 1
33 #ifndef __GXX_EXPERIMENTAL_CXX0X__
41 namespace std _GLIBCXX_VISIBILITY(default)
46 template<
typename _Value,
51 :
public _GLIBCXX_STD_C::unordered_set<_Value, _Hash, _Pred, _Alloc>,
55 typedef _GLIBCXX_STD_C::unordered_set<_Value, _Hash,
63 typedef typename _Base::size_type size_type;
64 typedef typename _Base::hasher hasher;
65 typedef typename _Base::key_equal key_equal;
66 typedef typename _Base::allocator_type allocator_type;
68 typedef typename _Base::key_type key_type;
69 typedef typename _Base::value_type value_type;
78 const hasher& __hf = hasher(),
79 const key_equal& __eql = key_equal(),
80 const allocator_type& __a = allocator_type())
81 :
_Base(__n, __hf, __eql, __a) { }
83 template<
typename _InputIterator>
86 const hasher& __hf = hasher(),
87 const key_equal& __eql = key_equal(),
88 const allocator_type& __a = allocator_type())
105 const hasher& __hf = hasher(),
106 const key_equal& __eql = key_equal(),
107 const allocator_type& __a = allocator_type())
113 *
static_cast<_Base*
>(
this) = __x;
114 this->_M_invalidate_all();
147 this->_M_invalidate_all();
152 {
return iterator(_Base::begin(),
this); }
160 {
return iterator(_Base::end(),
this); }
181 insert(
const value_type& __obj)
184 __pair_type __res = _Base::insert(__obj);
192 return iterator(_Base::insert(__hint.
base(), __obj),
this);
196 insert(value_type&& __obj)
199 __pair_type __res = _Base::insert(std::move(__obj));
207 return iterator(_Base::insert(__hint.
base(), std::move(__obj)),
this);
212 { _Base::insert(__l); }
214 template<
typename _InputIterator>
216 insert(_InputIterator __first, _InputIterator __last)
218 __glibcxx_check_valid_range(__first, __last);
224 find(
const key_type& __key)
225 {
return iterator(_Base::find(__key),
this); }
228 find(
const key_type& __key)
const
232 equal_range(
const key_type& __key)
235 __pair_type __res = _Base::equal_range(__key);
241 equal_range(
const key_type& __key)
const
244 __res = _Base::equal_range(__key);
250 erase(
const key_type& __key)
254 if (__victim != _Base::end())
257 _Base::erase(__victim);
280 __tmp != __last.
base(); ++__tmp)
283 _M_message(__gnu_debug::__msg_valid_range)
284 ._M_iterator(__first,
"first")
285 ._M_iterator(__last,
"last"));
289 __last.
base()),
this);
293 _M_base() {
return *
this; }
296 _M_base()
const {
return *
this; }
307 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
313 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
317 {
return __x._M_equal(__y); }
319 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
321 operator!=(
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
322 const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
323 {
return !(__x == __y); }
327 template<
typename _Value,
332 :
public _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash, _Pred, _Alloc>,
336 typedef _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash,
337 _Pred, _Alloc>
_Base;
344 typedef typename _Base::size_type size_type;
345 typedef typename _Base::hasher hasher;
346 typedef typename _Base::key_equal key_equal;
347 typedef typename _Base::allocator_type allocator_type;
349 typedef typename _Base::key_type key_type;
350 typedef typename _Base::value_type value_type;
359 const hasher& __hf = hasher(),
360 const key_equal& __eql = key_equal(),
361 const allocator_type& __a = allocator_type())
362 :
_Base(__n, __hf, __eql, __a) { }
364 template<
typename _InputIterator>
367 const hasher& __hf = hasher(),
368 const key_equal& __eql = key_equal(),
369 const allocator_type& __a = allocator_type())
386 const hasher& __hf = hasher(),
387 const key_equal& __eql = key_equal(),
388 const allocator_type& __a = allocator_type())
394 *
static_cast<_Base*
>(
this) = __x;
395 this->_M_invalidate_all();
428 this->_M_invalidate_all();
433 {
return iterator(_Base::begin(),
this); }
441 {
return iterator(_Base::end(),
this); }
462 insert(
const value_type& __obj)
463 {
return iterator(_Base::insert(__obj),
this); }
469 return iterator(_Base::insert(__hint.
base(), __obj),
this);
473 insert(value_type&& __obj)
474 {
return iterator(_Base::insert(std::move(__obj)),
this); }
480 return iterator(_Base::insert(__hint.
base(), std::move(__obj)),
this);
485 { _Base::insert(__l); }
487 template<
typename _InputIterator>
489 insert(_InputIterator __first, _InputIterator __last)
491 __glibcxx_check_valid_range(__first, __last);
497 find(
const key_type& __key)
498 {
return iterator(_Base::find(__key),
this); }
501 find(
const key_type& __key)
const
505 equal_range(
const key_type& __key)
508 __pair_type __res = _Base::equal_range(__key);
514 equal_range(
const key_type& __key)
const
517 __res = _Base::equal_range(__key);
523 erase(
const key_type& __key)
527 _Base::equal_range(__key);
531 _Base::erase(__victim++);
554 __tmp != __last.
base(); ++__tmp)
557 _M_message(__gnu_debug::__msg_valid_range)
558 ._M_iterator(__first,
"first")
559 ._M_iterator(__last,
"last"));
563 __last.
base()),
this);
567 _M_base() {
return *
this; }
570 _M_base()
const {
return *
this; }
581 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
587 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
591 {
return __x._M_equal(__y); }
593 template<
typename _Value,
typename _Hash,
typename _Pred,
typename _Alloc>
595 operator!=(
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
596 const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
597 {
return !(__x == __y); }
602 #endif // __GXX_EXPERIMENTAL_CXX0X__
Struct holding two objects of arbitrary type.
_T1 first
second_type is the second bound type
void _M_swap(_Safe_sequence_base &__x)
#define __glibcxx_check_insert(_Position)
void _M_invalidate_if(_Predicate __pred)
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
One of the comparison functors.
Primary class template hash.
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.
Class std::unordered_set with safety/checking/debug instrumentation.
#define __glibcxx_check_erase(_Position)
A standard container composed of unique keys (containing at most one of each key value) in which the ...
Base class for constructing a safe sequence type that tracks iterators that reference it...
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
_Iterator base() const
Return the underlying iterator.
Class std::unordered_multiset with safety/checking/debug instrumentation.
#define __glibcxx_check_erase_range(_First, _Last)
The standard allocator, as per [20.4].Further details: http://gcc.gnu.org/onlinedocs/libstdc++/manual...
_T2 second
first is a copy of the first object
A standard container composed of equivalent keys (possibly containing multiple of each key value) in ...