29 #ifndef _GLIBCXX_PROFILE_MULTIMAP_H
30 #define _GLIBCXX_PROFILE_MULTIMAP_H 1
34 namespace std _GLIBCXX_VISIBILITY(default)
39 template<
typename _Key,
typename _Tp,
typename _Compare = std::less<_Key>,
40 typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
42 :
public _GLIBCXX_STD_C::multimap<_Key, _Tp, _Compare, _Allocator>
44 typedef _GLIBCXX_STD_C::multimap<_Key, _Tp, _Compare, _Allocator>
_Base;
48 typedef _Key key_type;
49 typedef _Tp mapped_type;
51 typedef _Compare key_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 multimap(
const _Compare& __comp = _Compare(),
68 const _Allocator& __a = _Allocator())
69 :
_Base(__comp, __a) { }
71 template<
typename _InputIterator>
72 multimap(_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& __c = _Compare(),
90 const allocator_type& __a = allocator_type())
91 :
_Base(__l, __c, __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;
184 {
return iterator(_Base::insert(__x)); }
186 #ifdef __GXX_EXPERIMENTAL_CXX0X__
187 template<
typename _Pair,
typename =
typename
192 {
return iterator(_Base::insert(std::forward<_Pair>(__x))); }
195 #ifdef __GXX_EXPERIMENTAL_CXX0X__
198 { _Base::insert(__list); }
202 #ifdef __GXX_EXPERIMENTAL_CXX0X__
203 insert(const_iterator __position,
const value_type& __x)
205 insert(iterator __position,
const value_type& __x)
207 {
return iterator(_Base::insert(__position, __x)); }
209 #ifdef __GXX_EXPERIMENTAL_CXX0X__
210 template<
typename _Pair,
typename =
typename
214 insert(const_iterator __position, _Pair&& __x)
215 {
return iterator(_Base::insert(__position,
216 std::forward<_Pair>(__x))); }
219 template<
typename _InputIterator>
221 insert(_InputIterator __first, _InputIterator __last)
222 { _Base::insert(__first, __last); }
224 #ifdef __GXX_EXPERIMENTAL_CXX0X__
226 erase(const_iterator __position)
227 {
return iterator(_Base::erase(__position)); }
230 erase(iterator __position)
231 {
return iterator(_Base::erase(__position)); }
234 erase(iterator __position)
235 { _Base::erase(__position); }
239 erase(
const key_type& __x)
242 size_type __count = 0;
245 iterator __victim = __victims.
first++;
246 _Base::erase(__victim);
252 #ifdef __GXX_EXPERIMENTAL_CXX0X__
254 erase(const_iterator __first, const_iterator __last)
255 {
return iterator(_Base::erase(__first, __last)); }
258 erase(iterator __first, iterator __last)
259 { _Base::erase(__first, __last); }
264 { _Base::swap(__x); }
268 { this->erase(begin(), end()); }
271 using _Base::key_comp;
272 using _Base::value_comp;
276 find(
const key_type& __x)
277 {
return iterator(_Base::find(__x)); }
280 find(
const key_type& __x)
const
281 {
return const_iterator(_Base::find(__x)); }
286 lower_bound(
const key_type& __x)
287 {
return iterator(_Base::lower_bound(__x)); }
290 lower_bound(
const key_type& __x)
const
291 {
return const_iterator(_Base::lower_bound(__x)); }
294 upper_bound(
const key_type& __x)
295 {
return iterator(_Base::upper_bound(__x)); }
298 upper_bound(
const key_type& __x)
const
299 {
return const_iterator(_Base::upper_bound(__x)); }
302 equal_range(
const key_type& __x)
304 typedef typename _Base::iterator _Base_iterator;
306 _Base::equal_range(__x);
312 equal_range(
const key_type& __x)
const
314 typedef typename _Base::const_iterator _Base_const_iterator;
316 _Base::equal_range(__x);
318 const_iterator(__res.
second));
322 _M_base() {
return *
this; }
325 _M_base()
const {
return *
this; }
328 template<
typename _Key,
typename _Tp,
329 typename _Compare,
typename _Allocator>
333 {
return __lhs._M_base() == __rhs._M_base(); }
335 template<
typename _Key,
typename _Tp,
336 typename _Compare,
typename _Allocator>
340 {
return __lhs._M_base() != __rhs._M_base(); }
342 template<
typename _Key,
typename _Tp,
343 typename _Compare,
typename _Allocator>
345 operator<(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
346 const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
347 {
return __lhs._M_base() < __rhs._M_base(); }
349 template<
typename _Key,
typename _Tp,
350 typename _Compare,
typename _Allocator>
352 operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
353 const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
354 {
return __lhs._M_base() <= __rhs._M_base(); }
356 template<
typename _Key,
typename _Tp,
357 typename _Compare,
typename _Allocator>
359 operator>=(
const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
360 const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
361 {
return __lhs._M_base() >= __rhs._M_base(); }
363 template<
typename _Key,
typename _Tp,
364 typename _Compare,
typename _Allocator>
366 operator>(
const multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
367 const multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
368 {
return __lhs._M_base() > __rhs._M_base(); }
370 template<
typename _Key,
typename _Tp,
371 typename _Compare,
typename _Allocator>
373 swap(multimap<_Key, _Tp, _Compare, _Allocator>& __lhs,
374 multimap<_Key, _Tp, _Compare, _Allocator>& __rhs)
375 { __lhs.swap(__rhs); }