30 #ifndef _GLIBCXX_DEBUG_MULTIMAP_H
31 #define _GLIBCXX_DEBUG_MULTIMAP_H 1
37 namespace std _GLIBCXX_VISIBILITY(default)
42 template<
typename _Key,
typename _Tp,
typename _Compare = std::less<_Key>,
43 typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
45 :
public _GLIBCXX_STD_C::multimap<_Key, _Tp, _Compare, _Allocator>,
47 _Compare, _Allocator> >
49 typedef _GLIBCXX_STD_C::multimap<_Key, _Tp, _Compare, _Allocator>
_Base;
57 typedef _Key key_type;
58 typedef _Tp mapped_type;
60 typedef _Compare key_compare;
61 typedef _Allocator allocator_type;
62 typedef typename _Base::reference reference;
63 typedef typename _Base::const_reference const_reference;
70 typedef typename _Base::size_type size_type;
71 typedef typename _Base::difference_type difference_type;
72 typedef typename _Base::pointer pointer;
73 typedef typename _Base::const_pointer const_pointer;
78 explicit multimap(
const _Compare& __comp = _Compare(),
79 const _Allocator& __a = _Allocator())
80 :
_Base(__comp, __a) { }
82 template<
typename _InputIterator>
83 multimap(_InputIterator __first, _InputIterator __last,
84 const _Compare& __comp = _Compare(),
85 const _Allocator& __a = _Allocator())
97 #ifdef __GXX_EXPERIMENTAL_CXX0X__
103 const _Compare& __c = _Compare(),
104 const allocator_type& __a = allocator_type())
113 *
static_cast<_Base*
>(
this) = __x;
114 this->_M_invalidate_all();
118 #ifdef __GXX_EXPERIMENTAL_CXX0X__
138 using _Base::get_allocator;
143 {
return iterator(_Base::begin(),
this); }
151 {
return iterator(_Base::end(),
this); }
173 #ifdef __GXX_EXPERIMENTAL_CXX0X__
194 using _Base::max_size;
199 {
return iterator(_Base::insert(__x),
this); }
201 #ifdef __GXX_EXPERIMENTAL_CXX0X__
202 template<
typename _Pair,
typename =
typename
207 {
return iterator(_Base::insert(std::forward<_Pair>(__x)),
this); }
210 #ifdef __GXX_EXPERIMENTAL_CXX0X__
213 { _Base::insert(__list); }
217 #ifdef __GXX_EXPERIMENTAL_CXX0X__
224 return iterator(_Base::insert(__position.
base(), __x),
this);
227 #ifdef __GXX_EXPERIMENTAL_CXX0X__
228 template<
typename _Pair,
typename =
typename
236 std::forward<_Pair>(__x)),
this);
240 template<
typename _InputIterator>
242 insert(_InputIterator __first, _InputIterator __last)
244 __glibcxx_check_valid_range(__first, __last);
249 #ifdef __GXX_EXPERIMENTAL_CXX0X__
267 _Base::erase(__position.
base());
272 erase(
const key_type& __x)
275 _Base::equal_range(__x);
276 size_type __count = 0;
278 while (__victim != __victims.
second)
281 _Base::erase(__victim++);
287 #ifdef __GXX_EXPERIMENTAL_CXX0X__
295 __victim != __last.
base(); ++__victim)
298 _M_message(__gnu_debug::__msg_valid_range)
299 ._M_iterator(__first,
"first")
300 ._M_iterator(__last,
"last"));
313 __victim != __last.
base(); ++__victim)
316 _M_message(__gnu_debug::__msg_valid_range)
317 ._M_iterator(__first,
"first")
318 ._M_iterator(__last,
"last"));
321 _Base::erase(__first.
base(), __last.
base());
335 this->_M_invalidate_all();
340 using _Base::key_comp;
341 using _Base::value_comp;
345 find(
const key_type& __x)
346 {
return iterator(_Base::find(__x),
this); }
349 find(
const key_type& __x)
const
355 lower_bound(
const key_type& __x)
356 {
return iterator(_Base::lower_bound(__x),
this); }
359 lower_bound(
const key_type& __x)
const
363 upper_bound(
const key_type& __x)
364 {
return iterator(_Base::upper_bound(__x),
this); }
367 upper_bound(
const key_type& __x)
const
371 equal_range(
const key_type& __x)
374 _Base::equal_range(__x);
380 equal_range(
const key_type& __x)
const
383 _Base::equal_range(__x);
389 _M_base() {
return *
this; }
392 _M_base()
const {
return *
this; }
403 template<
typename _Key,
typename _Tp,
404 typename _Compare,
typename _Allocator>
408 {
return __lhs._M_base() == __rhs._M_base(); }
410 template<
typename _Key,
typename _Tp,
411 typename _Compare,
typename _Allocator>
415 {
return __lhs._M_base() != __rhs._M_base(); }
417 template<
typename _Key,
typename _Tp,
418 typename _Compare,
typename _Allocator>
420 operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
421 const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
422 {
return __lhs._M_base() < __rhs._M_base(); }
424 template<
typename _Key,
typename _Tp,
425 typename _Compare,
typename _Allocator>
427 operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
428 const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
429 {
return __lhs._M_base() <= __rhs._M_base(); }
431 template<
typename _Key,
typename _Tp,
432 typename _Compare,
typename _Allocator>
434 operator>=(
const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
435 const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
436 {
return __lhs._M_base() >= __rhs._M_base(); }
438 template<
typename _Key,
typename _Tp,
439 typename _Compare,
typename _Allocator>
441 operator>(
const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
442 const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
443 {
return __lhs._M_base() > __rhs._M_base(); }
445 template<
typename _Key,
typename _Tp,
446 typename _Compare,
typename _Allocator>
448 swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
449 multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
450 { __lhs.swap(__rhs); }
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)
Class std::multimap with safety/checking/debug instrumentation.
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
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.
constexpr size_t size() const
Returns the total number of bits.
#define __glibcxx_check_erase(_Position)
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.
size_t count() const
Returns the number of bits which are set.
#define __glibcxx_check_erase_range(_First, _Last)
_T2 second
first is a copy of the first object
A standard container made up of (key,value) pairs, which can be retrieved based on a key...