30 #ifndef _GLIBCXX_DEBUG_UNORDERED_MAP
31 #define _GLIBCXX_DEBUG_UNORDERED_MAP 1
33 #ifndef __GXX_EXPERIMENTAL_CXX0X__
41 namespace std _GLIBCXX_VISIBILITY(default)
46 template<
typename _Key,
typename _Tp,
51 :
public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>,
55 typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _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)
191 return iterator(_Base::insert(__hint.
base(), __obj),
this);
194 template<
typename _Pair,
typename =
typename
196 value_type>::value>::type>
198 insert(_Pair&& __obj)
201 _Base::insert(std::forward<_Pair>(__obj));
205 template<
typename _Pair,
typename =
typename
207 value_type>::value>::type>
213 std::forward<_Pair>(__obj)),
219 { _Base::insert(__l); }
221 template<
typename _InputIterator>
223 insert(_InputIterator __first, _InputIterator __last)
225 __glibcxx_check_valid_range(__first, __last);
231 find(
const key_type& __key)
232 {
return iterator(_Base::find(__key),
this); }
235 find(
const key_type& __key)
const
239 equal_range(
const key_type& __key)
242 _Base::equal_range(__key);
248 equal_range(
const key_type& __key)
const
251 _Base::equal_range(__key);
257 erase(
const key_type& __key)
261 if (__victim != _Base::end())
264 _Base::erase(__victim);
287 __tmp != __last.
base(); ++__tmp)
290 _M_message(__gnu_debug::__msg_valid_range)
291 ._M_iterator(__first,
"first")
292 ._M_iterator(__last,
"last"));
296 __last.
base()),
this);
300 _M_base() {
return *
this; }
303 _M_base()
const {
return *
this; }
314 template<
typename _Key,
typename _Tp,
typename _Hash,
315 typename _Pred,
typename _Alloc>
321 template<
typename _Key,
typename _Tp,
typename _Hash,
322 typename _Pred,
typename _Alloc>
326 {
return __x._M_equal(__y); }
328 template<
typename _Key,
typename _Tp,
typename _Hash,
329 typename _Pred,
typename _Alloc>
331 operator!=(
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
332 const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
333 {
return !(__x == __y); }
337 template<
typename _Key,
typename _Tp,
342 :
public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
347 typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash,
348 _Pred, _Alloc>
_Base;
355 typedef typename _Base::size_type size_type;
356 typedef typename _Base::hasher hasher;
357 typedef typename _Base::key_equal key_equal;
358 typedef typename _Base::allocator_type allocator_type;
360 typedef typename _Base::key_type key_type;
361 typedef typename _Base::value_type value_type;
370 const hasher& __hf = hasher(),
371 const key_equal& __eql = key_equal(),
372 const allocator_type& __a = allocator_type())
373 :
_Base(__n, __hf, __eql, __a) { }
375 template<
typename _InputIterator>
378 const hasher& __hf = hasher(),
379 const key_equal& __eql = key_equal(),
380 const allocator_type& __a = allocator_type())
397 const hasher& __hf = hasher(),
398 const key_equal& __eql = key_equal(),
399 const allocator_type& __a = allocator_type())
405 *
static_cast<_Base*
>(
this) = __x;
406 this->_M_invalidate_all();
439 this->_M_invalidate_all();
444 {
return iterator(_Base::begin(),
this); }
452 {
return iterator(_Base::end(),
this); }
473 insert(
const value_type& __obj)
474 {
return iterator(_Base::insert(__obj),
this); }
480 return iterator(_Base::insert(__hint.
base(), __obj),
this);
483 template<
typename _Pair,
typename =
typename
485 value_type>::value>::type>
487 insert(_Pair&& __obj)
488 {
return iterator(_Base::insert(std::forward<_Pair>(__obj)),
this); }
490 template<
typename _Pair,
typename =
typename
492 value_type>::value>::type>
498 std::forward<_Pair>(__obj)),
504 { _Base::insert(__l); }
506 template<
typename _InputIterator>
508 insert(_InputIterator __first, _InputIterator __last)
510 __glibcxx_check_valid_range(__first, __last);
516 find(
const key_type& __key)
517 {
return iterator(_Base::find(__key),
this); }
520 find(
const key_type& __key)
const
524 equal_range(
const key_type& __key)
527 _Base::equal_range(__key);
533 equal_range(
const key_type& __key)
const
536 _Base::equal_range(__key);
542 erase(
const key_type& __key)
546 _Base::equal_range(__key);
550 _Base::erase(__victim++);
573 __tmp != __last.
base(); ++__tmp)
576 _M_message(__gnu_debug::__msg_valid_range)
577 ._M_iterator(__first,
"first")
578 ._M_iterator(__last,
"last"));
582 __last.
base()),
this);
586 _M_base() {
return *
this; }
589 _M_base()
const {
return *
this; }
600 template<
typename _Key,
typename _Tp,
typename _Hash,
601 typename _Pred,
typename _Alloc>
607 template<
typename _Key,
typename _Tp,
typename _Hash,
608 typename _Pred,
typename _Alloc>
612 {
return __x._M_equal(__y); }
614 template<
typename _Key,
typename _Tp,
typename _Hash,
615 typename _Pred,
typename _Alloc>
617 operator!=(
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
618 const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
619 {
return !(__x == __y); }
624 #endif // __GXX_EXPERIMENTAL_CXX0X__