56#ifndef _STL_MULTISET_H
57#define _STL_MULTISET_H 1
60#if __cplusplus >= 201103L
64namespace 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)
105 typedef _Compare key_compare;
106 typedef _Compare value_compare;
107 typedef _Alloc allocator_type;
112 rebind<_Key>::other _Key_alloc_type;
115 key_compare, _Key_alloc_type> _Rep_type;
123 typedef typename _Alloc_traits::const_pointer const_pointer;
124 typedef typename _Alloc_traits::reference reference;
125 typedef typename _Alloc_traits::const_reference const_reference;
133 typedef typename _Rep_type::size_type size_type;
153 const allocator_type& __a = allocator_type())
154 : _M_t(__comp, _Key_alloc_type(__a)) { }
165 template<
typename _InputIterator>
168 { _M_t._M_insert_equal(__first, __last); }
181 template<
typename _InputIterator>
183 const _Compare& __comp,
184 const allocator_type& __a = allocator_type())
185 : _M_t(__comp, _Key_alloc_type(__a))
186 { _M_t._M_insert_equal(__first, __last); }
198#if __cplusplus >= 201103L
208 : _M_t(
std::move(__x._M_t)) { }
221 const _Compare& __comp = _Compare(),
222 const allocator_type& __a = allocator_type())
223 : _M_t(__comp, _Key_alloc_type(__a))
224 { _M_t._M_insert_equal(
__l.begin(),
__l.end()); }
229 : _M_t(_Compare(), _Key_alloc_type(__a)) { }
233 : _M_t(__m._M_t, _Key_alloc_type(__a)) { }
238 && _Alloc_traits::_S_always_equal())
239 : _M_t(
std::move(__m._M_t), _Key_alloc_type(__a)) { }
243 : _M_t(_Compare(), _Key_alloc_type(__a))
244 { _M_t._M_insert_equal(
__l.begin(),
__l.end()); }
247 template<
typename _InputIterator>
249 const allocator_type& __a)
250 : _M_t(_Compare(), _Key_alloc_type(__a))
251 { _M_t._M_insert_equal(__first, __last); }
268#if __cplusplus >= 201103L
287 _M_t._M_assign_equal(
__l.begin(),
__l.end());
297 {
return _M_t.key_comp(); }
301 {
return _M_t.key_comp(); }
305 {
return allocator_type(_M_t.get_allocator()); }
314 {
return _M_t.begin(); }
323 {
return _M_t.end(); }
332 {
return _M_t.rbegin(); }
341 {
return _M_t.rend(); }
343#if __cplusplus >= 201103L
351 {
return _M_t.begin(); }
360 {
return _M_t.end(); }
369 {
return _M_t.rbegin(); }
378 {
return _M_t.rend(); }
384 {
return _M_t.empty(); }
389 {
return _M_t.size(); }
394 {
return _M_t.max_size(); }
410 { _M_t.swap(__x._M_t); }
413#if __cplusplus >= 201103L
426 template<
typename...
_Args>
452 template<
typename...
_Args>
456 return _M_t._M_emplace_hint_equal(
__pos,
474 {
return _M_t._M_insert_equal(__x); }
476#if __cplusplus >= 201103L
479 {
return _M_t._M_insert_equal(std::move(__x)); }
504 {
return _M_t._M_insert_equal_(
__position, __x); }
506#if __cplusplus >= 201103L
509 {
return _M_t._M_insert_equal_(
__position, std::move(__x)); }
520 template<
typename _InputIterator>
523 { _M_t._M_insert_equal(__first, __last); }
525#if __cplusplus >= 201103L
535 { this->
insert(__l.begin(),
__l.end()); }
538#if __cplusplus >= 201103L
554 _GLIBCXX_ABI_TAG_CXX11
587 {
return _M_t.erase(__x); }
589#if __cplusplus >= 201103L
606 _GLIBCXX_ABI_TAG_CXX11
609 {
return _M_t.erase(__first, __last); }
625 { _M_t.erase(__first, __last); }
648 {
return _M_t.count(__x); }
650#if __cplusplus > 201103L
651 template<
typename _Kt>
653 count(
const _Kt& __x)
const ->
decltype(_M_t._M_count_tr(__x))
654 {
return _M_t._M_count_tr(__x); }
674 {
return _M_t.find(__x); }
677 find(
const key_type& __x)
const
678 {
return _M_t.find(__x); }
680#if __cplusplus > 201103L
681 template<
typename _Kt>
684 ->
decltype(iterator{_M_t._M_find_tr(__x)})
685 {
return iterator{_M_t._M_find_tr(__x)}; }
687 template<
typename _Kt>
689 find(
const _Kt& __x)
const
690 ->
decltype(const_iterator{_M_t._M_find_tr(__x)})
691 {
return const_iterator{_M_t._M_find_tr(__x)}; }
709 {
return _M_t.lower_bound(__x); }
713 {
return _M_t.lower_bound(__x); }
715#if __cplusplus > 201103L
716 template<
typename _Kt>
719 ->
decltype(iterator(_M_t._M_lower_bound_tr(__x)))
720 {
return iterator(_M_t._M_lower_bound_tr(__x)); }
722 template<
typename _Kt>
725 ->
decltype(iterator(_M_t._M_lower_bound_tr(__x)))
726 {
return iterator(_M_t._M_lower_bound_tr(__x)); }
739 {
return _M_t.upper_bound(__x); }
743 {
return _M_t.upper_bound(__x); }
745#if __cplusplus > 201103L
746 template<
typename _Kt>
749 ->
decltype(iterator(_M_t._M_upper_bound_tr(__x)))
750 {
return iterator(_M_t._M_upper_bound_tr(__x)); }
752 template<
typename _Kt>
755 ->
decltype(iterator(_M_t._M_upper_bound_tr(__x)))
756 {
return iterator(_M_t._M_upper_bound_tr(__x)); }
778 {
return _M_t.equal_range(__x); }
782 {
return _M_t.equal_range(__x); }
784#if __cplusplus > 201103L
785 template<
typename _Kt>
788 ->
decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
789 {
return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
791 template<
typename _Kt>
794 ->
decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
795 {
return pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)); }
799 template<
typename _K1,
typename _C1,
typename _A1>
801 operator==(
const multiset<_K1, _C1, _A1>&,
802 const multiset<_K1, _C1, _A1>&);
804 template<
typename _K1,
typename _C1,
typename _A1>
806 operator< (
const multiset<_K1, _C1, _A1>&,
807 const multiset<_K1, _C1, _A1>&);
821 template<
typename _Key,
typename _Compare,
typename _Alloc>
825 {
return __x._M_t ==
__y._M_t; }
838 template<
typename _Key,
typename _Compare,
typename _Alloc>
842 {
return __x._M_t <
__y._M_t; }
845 template<
typename _Key,
typename _Compare,
typename _Alloc>
849 {
return !(__x ==
__y); }
852 template<
typename _Key,
typename _Compare,
typename _Alloc>
856 {
return __y < __x; }
859 template<
typename _Key,
typename _Compare,
typename _Alloc>
863 {
return !(
__y < __x); }
866 template<
typename _Key,
typename _Compare,
typename _Alloc>
870 {
return !(__x <
__y); }
873 template<
typename _Key,
typename _Compare,
typename _Alloc>
880_GLIBCXX_END_NAMESPACE_CONTAINER
ISO C++ entities toplevel namespace is std.
A standard container made up of elements, which can be retrieved in logarithmic time.
multiset & operator=(const multiset &__x)
Multiset assignment operator.
multiset(multiset &&__m, const allocator_type &__a) noexcept(is_nothrow_copy_constructible< _Compare >::value &&_Alloc_traits::_S_always_equal())
Allocator-extended move constructor.
iterator emplace(_Args &&... __args)
Builds and inserts an element into the multiset.
multiset(_InputIterator __first, _InputIterator __last, const allocator_type &__a)
Allocator-extended range constructor.
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Builds and inserts an element into the multiset.
multiset(const multiset &__x)
Multiset copy constructor.
reverse_iterator crend() const noexcept
_GLIBCXX_ABI_TAG_CXX11 iterator erase(const_iterator __first, const_iterator __last)
Erases a [first,last) range of elements from a multiset.
reverse_iterator crbegin() const noexcept
multiset(const _Compare &__comp, const allocator_type &__a=allocator_type())
Creates a multiset with no elements.
multiset(const multiset &__m, const allocator_type &__a)
Allocator-extended copy constructor.
void swap(multiset &__x) noexcept(/*conditional */)
Swaps data with another multiset.
iterator cbegin() const noexcept
value_compare value_comp() const
Returns the comparison object.
multiset(initializer_list< value_type > __l, const allocator_type &__a)
Allocator-extended initialier-list constructor.
bool empty() const noexcept
Returns true if the set is empty.
iterator insert(const value_type &__x)
Inserts an element into the multiset.
reverse_iterator rbegin() const noexcept
reverse_iterator rend() const noexcept
void insert(initializer_list< value_type > __l)
Attempts to insert a list of elements into the multiset.
void insert(_InputIterator __first, _InputIterator __last)
A template function that tries to insert a range of elements.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
multiset(multiset &&__x) noexcept(is_nothrow_copy_constructible< _Compare >::value)
Multiset move constructor.
iterator find(const key_type &__x)
Tries to locate an element in a set.
multiset & operator=(initializer_list< value_type > __l)
Multiset list assignment operator.
size_type count(const key_type &__x) const
Finds the number of elements with given key.
size_type size() const noexcept
Returns the size of the set.
_GLIBCXX_ABI_TAG_CXX11 iterator erase(const_iterator __position)
Erases an element from a multiset.
iterator cend() const noexcept
multiset & operator=(multiset &&)=default
Move assignment operator.
allocator_type get_allocator() const noexcept
Returns the memory allocation object.
iterator upper_bound(const key_type &__x)
Finds the end of a subsequence matching given key.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
key_compare key_comp() const
Returns the comparison object.
multiset(_InputIterator __first, _InputIterator __last)
Builds a multiset from a range.
iterator lower_bound(const key_type &__x)
Finds the beginning of a subsequence matching given key.
iterator insert(const_iterator __position, const value_type &__x)
Inserts an element into the multiset.
iterator begin() const noexcept
multiset(initializer_list< value_type > __l, const _Compare &__comp=_Compare(), const allocator_type &__a=allocator_type())
Builds a multiset from an initializer_list.
multiset(_InputIterator __first, _InputIterator __last, const _Compare &__comp, const allocator_type &__a=allocator_type())
Builds a multiset from a range.
multiset(const allocator_type &__a)
Allocator-extended default constructor.
size_type max_size() const noexcept
Returns the maximum size of the set.
multiset() noexcept(/*conditional */)
Default constructor creates no elements.
iterator end() const noexcept
Uniform interface to C++98 and C++11 allocators.