56 #ifndef _STL_MULTISET_H
57 #define _STL_MULTISET_H 1
60 #if __cplusplus >= 201103L
64 namespace std _GLIBCXX_VISIBILITY(default)
66 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
90 template <
typename _Key,
typename _Compare = std::less<_Key>,
91 typename _Alloc = std::allocator<_Key> >
95 typedef typename _Alloc::value_type _Alloc_value_type;
96 __glibcxx_class_requires(_Key, _SGIAssignableConcept)
97 __glibcxx_class_requires4(_Compare,
bool, _Key, _Key,
98 _BinaryFunctionConcept)
99 __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)
103 typedef _Key key_type;
104 typedef _Key value_type;
105 typedef _Compare key_compare;
106 typedef _Compare value_compare;
107 typedef _Alloc allocator_type;
111 typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
113 typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
114 key_compare, _Key_alloc_type> _Rep_type;
119 typedef typename _Key_alloc_type::pointer pointer;
120 typedef typename _Key_alloc_type::const_pointer const_pointer;
121 typedef typename _Key_alloc_type::reference reference;
122 typedef typename _Key_alloc_type::const_reference const_reference;
126 typedef typename _Rep_type::const_iterator iterator;
127 typedef typename _Rep_type::const_iterator const_iterator;
130 typedef typename _Rep_type::size_type size_type;
131 typedef typename _Rep_type::difference_type difference_type;
147 const allocator_type& __a = allocator_type())
148 : _M_t(__comp, _Key_alloc_type(__a)) { }
159 template<
typename _InputIterator>
160 multiset(_InputIterator __first, _InputIterator __last)
162 { _M_t._M_insert_equal(__first, __last); }
175 template<
typename _InputIterator>
176 multiset(_InputIterator __first, _InputIterator __last,
177 const _Compare& __comp,
178 const allocator_type& __a = allocator_type())
179 : _M_t(__comp, _Key_alloc_type(__a))
180 { _M_t._M_insert_equal(__first, __last); }
192 #if __cplusplus >= 201103L
202 : _M_t(std::move(__x._M_t)) { }
215 const _Compare& __comp = _Compare(),
216 const allocator_type& __a = allocator_type())
217 : _M_t(__comp, _Key_alloc_type(__a))
218 { _M_t._M_insert_equal(__l.begin(), __l.end()); }
235 #if __cplusplus >= 201103L
269 this->
insert(__l.begin(), __l.end());
279 {
return _M_t.key_comp(); }
283 {
return _M_t.key_comp(); }
287 {
return allocator_type(_M_t.get_allocator()); }
296 {
return _M_t.begin(); }
304 end() const _GLIBCXX_NOEXCEPT
305 {
return _M_t.end(); }
314 {
return _M_t.rbegin(); }
323 {
return _M_t.rend(); }
325 #if __cplusplus >= 201103L
333 {
return _M_t.begin(); }
342 {
return _M_t.end(); }
351 {
return _M_t.rbegin(); }
360 {
return _M_t.rend(); }
366 {
return _M_t.empty(); }
371 {
return _M_t.size(); }
376 {
return _M_t.max_size(); }
391 { _M_t.swap(__x._M_t); }
394 #if __cplusplus >= 201103L
407 template<
typename... _Args>
410 {
return _M_t._M_emplace_equal(std::forward<_Args>(__args)...); }
433 template<
typename... _Args>
437 return _M_t._M_emplace_hint_equal(__pos,
438 std::forward<_Args>(__args)...);
455 {
return _M_t._M_insert_equal(__x); }
457 #if __cplusplus >= 201103L
460 {
return _M_t._M_insert_equal(std::move(__x)); }
484 insert(const_iterator __position,
const value_type& __x)
485 {
return _M_t._M_insert_equal_(__position, __x); }
487 #if __cplusplus >= 201103L
489 insert(const_iterator __position, value_type&& __x)
490 {
return _M_t._M_insert_equal_(__position, std::move(__x)); }
501 template<
typename _InputIterator>
503 insert(_InputIterator __first, _InputIterator __last)
504 { _M_t._M_insert_equal(__first, __last); }
506 #if __cplusplus >= 201103L
516 { this->
insert(__l.begin(), __l.end()); }
519 #if __cplusplus >= 201103L
537 {
return _M_t.erase(__position); }
551 { _M_t.erase(__position); }
567 {
return _M_t.erase(__x); }
569 #if __cplusplus >= 201103L
587 erase(const_iterator __first, const_iterator __last)
588 {
return _M_t.erase(__first, __last); }
604 { _M_t.erase(__first, __last); }
626 {
return _M_t.count(__x); }
644 {
return _M_t.find(__x); }
647 find(
const key_type& __x)
const
648 {
return _M_t.find(__x); }
665 {
return _M_t.lower_bound(__x); }
669 {
return _M_t.lower_bound(__x); }
681 {
return _M_t.upper_bound(__x); }
685 {
return _M_t.upper_bound(__x); }
706 {
return _M_t.equal_range(__x); }
710 {
return _M_t.equal_range(__x); }
713 template<
typename _K1,
typename _C1,
typename _A1>
718 template<
typename _K1,
typename _C1,
typename _A1>
720 operator< (const multiset<_K1, _C1, _A1>&,
735 template<
typename _Key,
typename _Compare,
typename _Alloc>
739 {
return __x._M_t == __y._M_t; }
752 template<
typename _Key,
typename _Compare,
typename _Alloc>
754 operator<(const multiset<_Key, _Compare, _Alloc>& __x,
756 {
return __x._M_t < __y._M_t; }
759 template<
typename _Key,
typename _Compare,
typename _Alloc>
763 {
return !(__x == __y); }
766 template<
typename _Key,
typename _Compare,
typename _Alloc>
770 {
return __y < __x; }
773 template<
typename _Key,
typename _Compare,
typename _Alloc>
775 operator<=(const multiset<_Key, _Compare, _Alloc>& __x,
777 {
return !(__y < __x); }
780 template<
typename _Key,
typename _Compare,
typename _Alloc>
784 {
return !(__x < __y); }
787 template<
typename _Key,
typename _Compare,
typename _Alloc>
793 _GLIBCXX_END_NAMESPACE_CONTAINER