57 #ifndef _STL_MULTIMAP_H
58 #define _STL_MULTIMAP_H 1
63 namespace std _GLIBCXX_VISIBILITY(default)
65 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
85 template <
typename _Key,
typename _Tp,
91 typedef _Key key_type;
92 typedef _Tp mapped_type;
94 typedef _Compare key_compare;
95 typedef _Alloc allocator_type;
99 typedef typename _Alloc::value_type _Alloc_value_type;
100 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
101 __glibcxx_class_requires4(_Compare,
bool, _Key, _Key,
102 _BinaryFunctionConcept)
103 __glibcxx_class_requires2(
value_type, _Alloc_value_type, _SameTypeConcept)
109 friend class multimap<_Key, _Tp, _Compare, _Alloc>;
113 value_compare(_Compare __c)
123 typedef typename _Alloc::template rebind<value_type>::other
126 typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
127 key_compare, _Pair_alloc_type> _Rep_type;
134 typedef typename _Pair_alloc_type::pointer pointer;
135 typedef typename _Pair_alloc_type::const_pointer const_pointer;
136 typedef typename _Pair_alloc_type::reference reference;
137 typedef typename _Pair_alloc_type::const_reference const_reference;
138 typedef typename _Rep_type::iterator iterator;
139 typedef typename _Rep_type::const_iterator const_iterator;
140 typedef typename _Rep_type::size_type size_type;
141 typedef typename _Rep_type::difference_type difference_type;
160 const allocator_type& __a = allocator_type())
161 : _M_t(__comp, __a) { }
173 #ifdef __GXX_EXPERIMENTAL_CXX0X__
182 : _M_t(std::move(__x._M_t)) { }
195 const _Compare& __comp = _Compare(),
196 const allocator_type& __a = allocator_type())
198 { _M_t._M_insert_equal(__l.begin(), __l.end()); }
210 template<
typename _InputIterator>
211 multimap(_InputIterator __first, _InputIterator __last)
213 { _M_t._M_insert_equal(__first, __last); }
226 template<
typename _InputIterator>
227 multimap(_InputIterator __first, _InputIterator __last,
228 const _Compare& __comp,
229 const allocator_type& __a = allocator_type())
231 { _M_t._M_insert_equal(__first, __last); }
256 #ifdef __GXX_EXPERIMENTAL_CXX0X__
289 this->
insert(__l.begin(), __l.end());
297 {
return _M_t.get_allocator(); }
307 {
return _M_t.begin(); }
316 {
return _M_t.begin(); }
325 {
return _M_t.end(); }
334 {
return _M_t.end(); }
343 {
return _M_t.rbegin(); }
350 const_reverse_iterator
352 {
return _M_t.rbegin(); }
361 {
return _M_t.rend(); }
368 const_reverse_iterator
370 {
return _M_t.rend(); }
372 #ifdef __GXX_EXPERIMENTAL_CXX0X__
380 {
return _M_t.begin(); }
389 {
return _M_t.end(); }
396 const_reverse_iterator
398 {
return _M_t.rbegin(); }
405 const_reverse_iterator
407 {
return _M_t.rend(); }
414 {
return _M_t.empty(); }
419 {
return _M_t.size(); }
424 {
return _M_t.max_size(); }
441 {
return _M_t._M_insert_equal(__x); }
443 #ifdef __GXX_EXPERIMENTAL_CXX0X__
444 template<
typename _Pair,
typename =
typename
446 value_type>::value>::type>
449 {
return _M_t._M_insert_equal(std::forward<_Pair>(__x)); }
473 #ifdef __GXX_EXPERIMENTAL_CXX0X__
478 {
return _M_t._M_insert_equal_(__position, __x); }
480 #ifdef __GXX_EXPERIMENTAL_CXX0X__
481 template<
typename _Pair,
typename =
typename
483 value_type>::value>::type>
485 insert(const_iterator __position, _Pair&& __x)
486 {
return _M_t._M_insert_equal_(__position,
487 std::forward<_Pair>(__x)); }
499 template<
typename _InputIterator>
501 insert(_InputIterator __first, _InputIterator __last)
502 { _M_t._M_insert_equal(__first, __last); }
504 #ifdef __GXX_EXPERIMENTAL_CXX0X__
514 { this->
insert(__l.begin(), __l.end()); }
517 #ifdef __GXX_EXPERIMENTAL_CXX0X__
535 {
return _M_t.erase(__position); }
540 {
return _M_t.erase(__position); }
553 erase(iterator __position)
554 { _M_t.erase(__position); }
570 {
return _M_t.erase(__x); }
572 #ifdef __GXX_EXPERIMENTAL_CXX0X__
589 erase(const_iterator __first, const_iterator __last)
590 {
return _M_t.erase(__first, __last); }
608 { _M_t.erase(__first, __last); }
624 { _M_t.swap(__x._M_t); }
643 {
return _M_t.key_comp(); }
651 {
return value_compare(_M_t.key_comp()); }
667 {
return _M_t.find(__x); }
681 find(
const key_type& __x)
const
682 {
return _M_t.find(__x); }
691 {
return _M_t.count(__x); }
706 {
return _M_t.lower_bound(__x); }
721 {
return _M_t.lower_bound(__x); }
731 {
return _M_t.upper_bound(__x); }
741 {
return _M_t.upper_bound(__x); }
758 {
return _M_t.equal_range(__x); }
775 {
return _M_t.equal_range(__x); }
777 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
782 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
784 operator<(const multimap<_K1, _T1, _C1, _A1>&,
798 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
802 {
return __x._M_t == __y._M_t; }
815 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
817 operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
819 {
return __x._M_t < __y._M_t; }
822 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
826 {
return !(__x == __y); }
829 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
833 {
return __y < __x; }
836 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
838 operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
840 {
return !(__y < __x); }
843 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
847 {
return !(__x < __y); }
850 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
856 _GLIBCXX_END_NAMESPACE_CONTAINER