57 #ifndef _STL_MULTISET_H
58 #define _STL_MULTISET_H 1
63 namespace std _GLIBCXX_VISIBILITY(default)
65 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
84 template <
typename _Key,
typename _Compare = std::less<_Key>,
85 typename _Alloc = std::allocator<_Key> >
89 typedef typename _Alloc::value_type _Alloc_value_type;
90 __glibcxx_class_requires(_Key, _SGIAssignableConcept)
91 __glibcxx_class_requires4(_Compare,
bool, _Key, _Key,
92 _BinaryFunctionConcept)
93 __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
97 typedef _Key key_type;
98 typedef _Key value_type;
99 typedef _Compare key_compare;
100 typedef _Compare value_compare;
101 typedef _Alloc allocator_type;
105 typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
107 typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
108 key_compare, _Key_alloc_type> _Rep_type;
113 typedef typename _Key_alloc_type::pointer pointer;
114 typedef typename _Key_alloc_type::const_pointer const_pointer;
115 typedef typename _Key_alloc_type::reference reference;
116 typedef typename _Key_alloc_type::const_reference const_reference;
120 typedef typename _Rep_type::const_iterator iterator;
121 typedef typename _Rep_type::const_iterator const_iterator;
124 typedef typename _Rep_type::size_type size_type;
125 typedef typename _Rep_type::difference_type difference_type;
141 const allocator_type& __a = allocator_type())
142 : _M_t(__comp, __a) { }
153 template<
typename _InputIterator>
154 multiset(_InputIterator __first, _InputIterator __last)
156 { _M_t._M_insert_equal(__first, __last); }
169 template<
typename _InputIterator>
170 multiset(_InputIterator __first, _InputIterator __last,
171 const _Compare& __comp,
172 const allocator_type& __a = allocator_type())
174 { _M_t._M_insert_equal(__first, __last); }
186 #ifdef __GXX_EXPERIMENTAL_CXX0X__
195 : _M_t(std::move(__x._M_t)) { }
208 const _Compare& __comp = _Compare(),
209 const allocator_type& __a = allocator_type())
211 { _M_t._M_insert_equal(__l.begin(), __l.end()); }
228 #ifdef __GXX_EXPERIMENTAL_CXX0X__
261 this->
insert(__l.begin(), __l.end());
271 {
return _M_t.key_comp(); }
275 {
return _M_t.key_comp(); }
279 {
return _M_t.get_allocator(); }
288 {
return _M_t.begin(); }
297 {
return _M_t.end(); }
306 {
return _M_t.rbegin(); }
315 {
return _M_t.rend(); }
317 #ifdef __GXX_EXPERIMENTAL_CXX0X__
325 {
return _M_t.begin(); }
334 {
return _M_t.end(); }
343 {
return _M_t.rbegin(); }
352 {
return _M_t.rend(); }
358 {
return _M_t.empty(); }
363 {
return _M_t.size(); }
368 {
return _M_t.max_size(); }
383 { _M_t.swap(__x._M_t); }
399 {
return _M_t._M_insert_equal(__x); }
401 #ifdef __GXX_EXPERIMENTAL_CXX0X__
404 {
return _M_t._M_insert_equal(std::move(__x)); }
428 insert(const_iterator __position,
const value_type& __x)
429 {
return _M_t._M_insert_equal_(__position, __x); }
431 #ifdef __GXX_EXPERIMENTAL_CXX0X__
433 insert(const_iterator __position, value_type&& __x)
434 {
return _M_t._M_insert_equal_(__position, std::move(__x)); }
445 template<
typename _InputIterator>
447 insert(_InputIterator __first, _InputIterator __last)
448 { _M_t._M_insert_equal(__first, __last); }
450 #ifdef __GXX_EXPERIMENTAL_CXX0X__
460 { this->
insert(__l.begin(), __l.end()); }
463 #ifdef __GXX_EXPERIMENTAL_CXX0X__
481 {
return _M_t.erase(__position); }
495 { _M_t.erase(__position); }
511 {
return _M_t.erase(__x); }
513 #ifdef __GXX_EXPERIMENTAL_CXX0X__
530 erase(const_iterator __first, const_iterator __last)
531 {
return _M_t.erase(__first, __last); }
547 { _M_t.erase(__first, __last); }
569 {
return _M_t.count(__x); }
587 {
return _M_t.find(__x); }
590 find(
const key_type& __x)
const
591 {
return _M_t.find(__x); }
608 {
return _M_t.lower_bound(__x); }
612 {
return _M_t.lower_bound(__x); }
624 {
return _M_t.upper_bound(__x); }
628 {
return _M_t.upper_bound(__x); }
649 {
return _M_t.equal_range(__x); }
653 {
return _M_t.equal_range(__x); }
655 template<
typename _K1,
typename _C1,
typename _A1>
660 template<
typename _K1,
typename _C1,
typename _A1>
662 operator< (const multiset<_K1, _C1, _A1>&,
677 template<
typename _Key,
typename _Compare,
typename _Alloc>
681 {
return __x._M_t == __y._M_t; }
694 template<
typename _Key,
typename _Compare,
typename _Alloc>
696 operator<(const multiset<_Key, _Compare, _Alloc>& __x,
698 {
return __x._M_t < __y._M_t; }
701 template<
typename _Key,
typename _Compare,
typename _Alloc>
705 {
return !(__x == __y); }
708 template<
typename _Key,
typename _Compare,
typename _Alloc>
712 {
return __y < __x; }
715 template<
typename _Key,
typename _Compare,
typename _Alloc>
717 operator<=(const multiset<_Key, _Compare, _Alloc>& __x,
719 {
return !(__y < __x); }
722 template<
typename _Key,
typename _Compare,
typename _Alloc>
726 {
return !(__x < __y); }
729 template<
typename _Key,
typename _Compare,
typename _Alloc>
735 _GLIBCXX_END_NAMESPACE_CONTAINER