29 #ifndef _GLIBCXX_PROFILE_MULTISET_H
30 #define _GLIBCXX_PROFILE_MULTISET_H 1
34 namespace std _GLIBCXX_VISIBILITY(default)
39 template<
typename _Key,
typename _Compare = std::less<_Key>,
40 typename _Allocator = std::allocator<_Key> >
42 :
public _GLIBCXX_STD_C::multiset<_Key, _Compare, _Allocator>
44 typedef _GLIBCXX_STD_C::multiset<_Key, _Compare, _Allocator>
_Base;
48 typedef _Key key_type;
49 typedef _Key value_type;
50 typedef _Compare key_compare;
51 typedef _Compare value_compare;
52 typedef _Allocator allocator_type;
53 typedef typename _Base::reference reference;
54 typedef typename _Base::const_reference const_reference;
56 typedef typename _Base::iterator iterator;
57 typedef typename _Base::const_iterator const_iterator;
58 typedef typename _Base::reverse_iterator reverse_iterator;
59 typedef typename _Base::const_reverse_iterator const_reverse_iterator;
61 typedef typename _Base::size_type size_type;
62 typedef typename _Base::difference_type difference_type;
63 typedef typename _Base::pointer pointer;
64 typedef typename _Base::const_pointer const_pointer;
67 explicit multiset(
const _Compare& __comp = _Compare(),
68 const _Allocator& __a = _Allocator())
69 :
_Base(__comp, __a) { }
71 template<
typename _InputIterator>
72 multiset(_InputIterator __first, _InputIterator __last,
73 const _Compare& __comp = _Compare(),
74 const _Allocator& __a = _Allocator())
75 :
_Base(__first, __last, __comp, __a) { }
83 #ifdef __GXX_EXPERIMENTAL_CXX0X__
85 :
_Base(std::move(__x))
89 const _Compare& __comp = _Compare(),
90 const allocator_type& __a = allocator_type())
91 :
_Base(__l, __comp, __a) { }
99 *
static_cast<_Base*
>(
this) = __x;
103 #ifdef __GXX_EXPERIMENTAL_CXX0X__
123 using _Base::get_allocator;
128 {
return iterator(_Base::begin()); }
132 {
return const_iterator(_Base::begin()); }
136 {
return iterator(_Base::end()); }
140 {
return const_iterator(_Base::end()); }
144 {
return reverse_iterator(end()); }
146 const_reverse_iterator
148 {
return const_reverse_iterator(end()); }
152 {
return reverse_iterator(begin()); }
154 const_reverse_iterator
156 {
return const_reverse_iterator(begin()); }
158 #ifdef __GXX_EXPERIMENTAL_CXX0X__
161 {
return const_iterator(_Base::begin()); }
165 {
return const_iterator(_Base::end()); }
167 const_reverse_iterator
169 {
return const_reverse_iterator(end()); }
171 const_reverse_iterator
173 {
return const_reverse_iterator(begin()); }
179 using _Base::max_size;
183 insert(
const value_type& __x)
184 {
return iterator(_Base::insert(__x)); }
186 #ifdef __GXX_EXPERIMENTAL_CXX0X__
188 insert(value_type&& __x)
189 {
return iterator(_Base::insert(std::move(__x))); }
193 insert(const_iterator __position,
const value_type& __x)
194 {
return iterator(_Base::insert(__position, __x)); }
196 #ifdef __GXX_EXPERIMENTAL_CXX0X__
198 insert(const_iterator __position, value_type&& __x)
199 {
return iterator(_Base::insert(__position, std::move(__x))); }
202 template<
typename _InputIterator>
204 insert(_InputIterator __first, _InputIterator __last)
205 { _Base::insert(__first, __last); }
207 #ifdef __GXX_EXPERIMENTAL_CXX0X__
210 { _Base::insert(__l); }
213 #ifdef __GXX_EXPERIMENTAL_CXX0X__
215 erase(const_iterator __position)
216 {
return iterator(_Base::erase(__position)); }
219 erase(iterator __position)
220 { _Base::erase(__position); }
224 erase(
const key_type& __x)
227 size_type __count = 0;
230 iterator __victim = __victims.
first++;
231 _Base::erase(__victim);
237 #ifdef __GXX_EXPERIMENTAL_CXX0X__
239 erase(const_iterator __first, const_iterator __last)
240 {
return iterator(_Base::erase(__first, __last)); }
243 erase(iterator __first, iterator __last)
244 { _Base::erase(__first, __last); }
249 { _Base::swap(__x); }
253 { this->erase(begin(), end()); }
256 using _Base::key_comp;
257 using _Base::value_comp;
261 find(
const key_type& __x)
262 {
return iterator(_Base::find(__x)); }
267 find(
const key_type& __x)
const
268 {
return const_iterator(_Base::find(__x)); }
273 lower_bound(
const key_type& __x)
274 {
return iterator(_Base::lower_bound(__x)); }
279 lower_bound(
const key_type& __x)
const
280 {
return const_iterator(_Base::lower_bound(__x)); }
283 upper_bound(
const key_type& __x)
284 {
return iterator(_Base::upper_bound(__x)); }
289 upper_bound(
const key_type& __x)
const
290 {
return const_iterator(_Base::upper_bound(__x)); }
293 equal_range(
const key_type& __x)
295 typedef typename _Base::iterator _Base_iterator;
297 _Base::equal_range(__x);
305 equal_range(
const key_type& __x)
const
307 typedef typename _Base::const_iterator _Base_iterator;
309 _Base::equal_range(__x);
311 const_iterator(__res.
second));
315 _M_base() {
return *
this; }
318 _M_base()
const {
return *
this; }
322 template<
typename _Key,
typename _Compare,
typename _Allocator>
326 {
return __lhs._M_base() == __rhs._M_base(); }
328 template<
typename _Key,
typename _Compare,
typename _Allocator>
332 {
return __lhs._M_base() != __rhs._M_base(); }
334 template<
typename _Key,
typename _Compare,
typename _Allocator>
336 operator<(const multiset<_Key, _Compare, _Allocator>& __lhs,
337 const multiset<_Key, _Compare, _Allocator>& __rhs)
338 {
return __lhs._M_base() < __rhs._M_base(); }
340 template<
typename _Key,
typename _Compare,
typename _Allocator>
342 operator<=(const multiset<_Key, _Compare, _Allocator>& __lhs,
343 const multiset<_Key, _Compare, _Allocator>& __rhs)
344 {
return __lhs._M_base() <= __rhs._M_base(); }
346 template<
typename _Key,
typename _Compare,
typename _Allocator>
348 operator>=(
const multiset<_Key, _Compare, _Allocator>& __lhs,
349 const multiset<_Key, _Compare, _Allocator>& __rhs)
350 {
return __lhs._M_base() >= __rhs._M_base(); }
352 template<
typename _Key,
typename _Compare,
typename _Allocator>
354 operator>(
const multiset<_Key, _Compare, _Allocator>& __lhs,
355 const multiset<_Key, _Compare, _Allocator>& __rhs)
356 {
return __lhs._M_base() > __rhs._M_base(); }
358 template<
typename _Key,
typename _Compare,
typename _Allocator>
360 swap(multiset<_Key, _Compare, _Allocator>& __x,
361 multiset<_Key, _Compare, _Allocator>& __y)
362 {
return __x.swap(__y); }
Struct holding two objects of arbitrary type.
_T1 first
second_type is the second bound type
A standard container made up of elements, which can be retrieved in logarithmic time.
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.
Class std::multiset wrapper with performance instrumentation.
size_t count() const
Returns the number of bits which are set.
_T2 second
first is a copy of the first object