1 // Multiset implementation -*- C++ -*-
3 // Copyright (C) 2001-2014 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
28 * Hewlett-Packard Company
30 * Permission to use, copy, modify, distribute and sell this software
31 * and its documentation for any purpose is hereby granted without fee,
32 * provided that the above copyright notice appear in all copies and
33 * that both that copyright notice and this permission notice appear
34 * in supporting documentation. Hewlett-Packard Company makes no
35 * representations about the suitability of this software for any
36 * purpose. It is provided "as is" without express or implied warranty.
40 * Silicon Graphics Computer Systems, Inc.
42 * Permission to use, copy, modify, distribute and sell this software
43 * and its documentation for any purpose is hereby granted without fee,
44 * provided that the above copyright notice appear in all copies and
45 * that both that copyright notice and this permission notice appear
46 * in supporting documentation. Silicon Graphics makes no
47 * representations about the suitability of this software for any
48 * purpose. It is provided "as is" without express or implied warranty.
51 /** @file bits/stl_multiset.h
52 * This is an internal header file, included by other library headers.
53 * Do not attempt to use it directly. @headername{set}
56 #ifndef _STL_MULTISET_H
57 #define _STL_MULTISET_H 1
59 #include <bits/concept_check.h>
60 #if __cplusplus >= 201103L
61 #include <initializer_list>
64 namespace std
_GLIBCXX_VISIBILITY(default)
66 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
69 * @brief A standard container made up of elements, which can be retrieved
70 * in logarithmic time.
72 * @ingroup associative_containers
75 * @tparam _Key Type of key objects.
76 * @tparam _Compare Comparison function object type, defaults to less<_Key>.
77 * @tparam _Alloc Allocator type, defaults to allocator<_Key>.
79 * Meets the requirements of a <a href="tables.html#65">container</a>, a
80 * <a href="tables.html#66">reversible container</a>, and an
81 * <a href="tables.html#69">associative container</a> (using equivalent
82 * keys). For a @c multiset<Key> the key_type and value_type are Key.
84 * Multisets support bidirectional iterators.
86 * The private tree data is declared exactly the same way for set and
87 * multiset; the distinction is made entirely in how the tree functions are
88 * called (*_unique versus *_equal, same as the standard).
90 template <typename _Key
, typename _Compare
= std::less
<_Key
>,
91 typename _Alloc
= std::allocator
<_Key
> >
94 // concept requirements
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
;
110 /// This turns a red-black tree into a [multi]set.
111 typedef typename
__gnu_cxx::__alloc_traits
<_Alloc
>::template
112 rebind
<_Key
>::other _Key_alloc_type
;
114 typedef _Rb_tree
<key_type
, value_type
, _Identity
<value_type
>,
115 key_compare
, _Key_alloc_type
> _Rep_type
;
116 /// The actual tree structure.
119 typedef __gnu_cxx::__alloc_traits
<_Key_alloc_type
> _Alloc_traits
;
122 typedef typename
_Alloc_traits::pointer pointer
;
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
;
126 // _GLIBCXX_RESOLVE_LIB_DEFECTS
127 // DR 103. set::iterator is required to be modifiable,
128 // but this allows modification of keys.
129 typedef typename
_Rep_type::const_iterator iterator
;
130 typedef typename
_Rep_type::const_iterator const_iterator
;
131 typedef typename
_Rep_type::const_reverse_iterator reverse_iterator
;
132 typedef typename
_Rep_type::const_reverse_iterator const_reverse_iterator
;
133 typedef typename
_Rep_type::size_type size_type
;
134 typedef typename
_Rep_type::difference_type difference_type
;
136 // allocation/deallocation
138 * @brief Default constructor creates no elements.
144 * @brief Creates a %multiset with no elements.
145 * @param __comp Comparator to use.
146 * @param __a An allocator object.
149 multiset(const _Compare
& __comp
,
150 const allocator_type
& __a
= allocator_type())
151 : _M_t(__comp
, _Key_alloc_type(__a
)) { }
154 * @brief Builds a %multiset from a range.
155 * @param __first An input iterator.
156 * @param __last An input iterator.
158 * Create a %multiset consisting of copies of the elements from
159 * [first,last). This is linear in N if the range is already sorted,
160 * and NlogN otherwise (where N is distance(__first,__last)).
162 template<typename _InputIterator
>
163 multiset(_InputIterator __first
, _InputIterator __last
)
165 { _M_t
._M_insert_equal(__first
, __last
); }
168 * @brief Builds a %multiset from a range.
169 * @param __first An input iterator.
170 * @param __last An input iterator.
171 * @param __comp A comparison functor.
172 * @param __a An allocator object.
174 * Create a %multiset consisting of copies of the elements from
175 * [__first,__last). This is linear in N if the range is already sorted,
176 * and NlogN otherwise (where N is distance(__first,__last)).
178 template<typename _InputIterator
>
179 multiset(_InputIterator __first
, _InputIterator __last
,
180 const _Compare
& __comp
,
181 const allocator_type
& __a
= allocator_type())
182 : _M_t(__comp
, _Key_alloc_type(__a
))
183 { _M_t
._M_insert_equal(__first
, __last
); }
186 * @brief %Multiset copy constructor.
187 * @param __x A %multiset of identical element and allocator types.
189 * The newly-created %multiset uses a copy of the allocation object used
192 multiset(const multiset
& __x
)
195 #if __cplusplus >= 201103L
197 * @brief %Multiset move constructor.
198 * @param __x A %multiset of identical element and allocator types.
200 * The newly-created %multiset contains the exact contents of @a __x.
201 * The contents of @a __x are a valid, but unspecified %multiset.
203 multiset(multiset
&& __x
)
204 noexcept(is_nothrow_copy_constructible
<_Compare
>::value
)
205 : _M_t(std::move(__x
._M_t
)) { }
208 * @brief Builds a %multiset from an initializer_list.
209 * @param __l An initializer_list.
210 * @param __comp A comparison functor.
211 * @param __a An allocator object.
213 * Create a %multiset consisting of copies of the elements from
214 * the list. This is linear in N if the list is already sorted,
215 * and NlogN otherwise (where N is @a __l.size()).
217 multiset(initializer_list
<value_type
> __l
,
218 const _Compare
& __comp
= _Compare(),
219 const allocator_type
& __a
= allocator_type())
220 : _M_t(__comp
, _Key_alloc_type(__a
))
221 { _M_t
._M_insert_equal(__l
.begin(), __l
.end()); }
223 /// Allocator-extended default constructor.
225 multiset(const allocator_type
& __a
)
226 : _M_t(_Compare(), _Key_alloc_type(__a
)) { }
228 /// Allocator-extended copy constructor.
229 multiset(const multiset
& __m
, const allocator_type
& __a
)
230 : _M_t(__m
._M_t
, _Key_alloc_type(__a
)) { }
232 /// Allocator-extended move constructor.
233 multiset(multiset
&& __m
, const allocator_type
& __a
)
234 noexcept(is_nothrow_copy_constructible
<_Compare
>::value
235 && _Alloc_traits::_S_always_equal())
236 : _M_t(std::move(__m
._M_t
), _Key_alloc_type(__a
)) { }
238 /// Allocator-extended initialier-list constructor.
239 multiset(initializer_list
<value_type
> __l
, const allocator_type
& __a
)
240 : _M_t(_Compare(), _Key_alloc_type(__a
))
241 { _M_t
._M_insert_equal(__l
.begin(), __l
.end()); }
243 /// Allocator-extended range constructor.
244 template<typename _InputIterator
>
245 multiset(_InputIterator __first
, _InputIterator __last
,
246 const allocator_type
& __a
)
247 : _M_t(_Compare(), _Key_alloc_type(__a
))
248 { _M_t
._M_insert_equal(__first
, __last
); }
252 * @brief %Multiset assignment operator.
253 * @param __x A %multiset of identical element and allocator types.
255 * All the elements of @a __x are copied, but unlike the copy
256 * constructor, the allocator object is not copied.
259 operator=(const multiset
& __x
)
265 #if __cplusplus >= 201103L
267 * @brief %Multiset move assignment operator.
268 * @param __x A %multiset of identical element and allocator types.
270 * The contents of @a __x are moved into this %multiset (without
271 * copying if the allocators compare equal or get moved on assignment).
272 * Afterwards @a __x is in a valid, but unspecified state.
275 operator=(multiset
&& __x
) noexcept(_Alloc_traits::_S_nothrow_move())
277 if (!_M_t
._M_move_assign(__x
._M_t
))
279 // The rvalue's allocator cannot be moved and is not equal,
280 // so we need to individually move each element.
282 insert(std::__make_move_if_noexcept_iterator(__x
._M_t
.begin()),
283 std::__make_move_if_noexcept_iterator(__x
._M_t
.end()));
290 * @brief %Multiset list assignment operator.
291 * @param __l An initializer_list.
293 * This function fills a %multiset with copies of the elements in the
294 * initializer list @a __l.
296 * Note that the assignment completely changes the %multiset and
297 * that the resulting %multiset's size is the same as the number
298 * of elements assigned. Old data may be lost.
301 operator=(initializer_list
<value_type
> __l
)
304 this->insert(__l
.begin(), __l
.end());
311 /// Returns the comparison object.
314 { return _M_t
.key_comp(); }
315 /// Returns the comparison object.
318 { return _M_t
.key_comp(); }
319 /// Returns the memory allocation object.
321 get_allocator() const _GLIBCXX_NOEXCEPT
322 { return allocator_type(_M_t
.get_allocator()); }
325 * Returns a read-only (constant) iterator that points to the first
326 * element in the %multiset. Iteration is done in ascending order
327 * according to the keys.
330 begin() const _GLIBCXX_NOEXCEPT
331 { return _M_t
.begin(); }
334 * Returns a read-only (constant) iterator that points one past the last
335 * element in the %multiset. Iteration is done in ascending order
336 * according to the keys.
339 end() const _GLIBCXX_NOEXCEPT
340 { return _M_t
.end(); }
343 * Returns a read-only (constant) reverse iterator that points to the
344 * last element in the %multiset. Iteration is done in descending order
345 * according to the keys.
348 rbegin() const _GLIBCXX_NOEXCEPT
349 { return _M_t
.rbegin(); }
352 * Returns a read-only (constant) reverse iterator that points to the
353 * last element in the %multiset. Iteration is done in descending order
354 * according to the keys.
357 rend() const _GLIBCXX_NOEXCEPT
358 { return _M_t
.rend(); }
360 #if __cplusplus >= 201103L
362 * Returns a read-only (constant) iterator that points to the first
363 * element in the %multiset. Iteration is done in ascending order
364 * according to the keys.
367 cbegin() const noexcept
368 { return _M_t
.begin(); }
371 * Returns a read-only (constant) iterator that points one past the last
372 * element in the %multiset. Iteration is done in ascending order
373 * according to the keys.
376 cend() const noexcept
377 { return _M_t
.end(); }
380 * Returns a read-only (constant) reverse iterator that points to the
381 * last element in the %multiset. Iteration is done in descending order
382 * according to the keys.
385 crbegin() const noexcept
386 { return _M_t
.rbegin(); }
389 * Returns a read-only (constant) reverse iterator that points to the
390 * last element in the %multiset. Iteration is done in descending order
391 * according to the keys.
394 crend() const noexcept
395 { return _M_t
.rend(); }
398 /// Returns true if the %set is empty.
400 empty() const _GLIBCXX_NOEXCEPT
401 { return _M_t
.empty(); }
403 /// Returns the size of the %set.
405 size() const _GLIBCXX_NOEXCEPT
406 { return _M_t
.size(); }
408 /// Returns the maximum size of the %set.
410 max_size() const _GLIBCXX_NOEXCEPT
411 { return _M_t
.max_size(); }
414 * @brief Swaps data with another %multiset.
415 * @param __x A %multiset of the same element and allocator types.
417 * This exchanges the elements between two multisets in constant time.
418 * (It is only swapping a pointer, an integer, and an instance of the @c
419 * Compare type (which itself is often stateless and empty), so it should
421 * Note that the global std::swap() function is specialized such that
422 * std::swap(s1,s2) will feed to this function.
426 #if __cplusplus >= 201103L
427 noexcept(_Alloc_traits::_S_nothrow_swap())
429 { _M_t
.swap(__x
._M_t
); }
432 #if __cplusplus >= 201103L
434 * @brief Builds and inserts an element into the %multiset.
435 * @param __args Arguments used to generate the element instance to be
437 * @return An iterator that points to the inserted element.
439 * This function inserts an element into the %multiset. Contrary
440 * to a std::set the %multiset does not rely on unique keys and thus
441 * multiple copies of the same element can be inserted.
443 * Insertion requires logarithmic time.
445 template<typename
... _Args
>
447 emplace(_Args
&&... __args
)
448 { return _M_t
._M_emplace_equal(std::forward
<_Args
>(__args
)...); }
451 * @brief Builds and inserts an element into the %multiset.
452 * @param __pos An iterator that serves as a hint as to where the
453 * element should be inserted.
454 * @param __args Arguments used to generate the element instance to be
456 * @return An iterator that points to the inserted element.
458 * This function inserts an element into the %multiset. Contrary
459 * to a std::set the %multiset does not rely on unique keys and thus
460 * multiple copies of the same element can be inserted.
462 * Note that the first parameter is only a hint and can potentially
463 * improve the performance of the insertion process. A bad hint would
464 * cause no gains in efficiency.
466 * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
467 * for more on @a hinting.
469 * Insertion requires logarithmic time (if the hint is not taken).
471 template<typename
... _Args
>
473 emplace_hint(const_iterator __pos
, _Args
&&... __args
)
475 return _M_t
._M_emplace_hint_equal(__pos
,
476 std::forward
<_Args
>(__args
)...);
481 * @brief Inserts an element into the %multiset.
482 * @param __x Element to be inserted.
483 * @return An iterator that points to the inserted element.
485 * This function inserts an element into the %multiset. Contrary
486 * to a std::set the %multiset does not rely on unique keys and thus
487 * multiple copies of the same element can be inserted.
489 * Insertion requires logarithmic time.
492 insert(const value_type
& __x
)
493 { return _M_t
._M_insert_equal(__x
); }
495 #if __cplusplus >= 201103L
497 insert(value_type
&& __x
)
498 { return _M_t
._M_insert_equal(std::move(__x
)); }
502 * @brief Inserts an element into the %multiset.
503 * @param __position An iterator that serves as a hint as to where the
504 * element should be inserted.
505 * @param __x Element to be inserted.
506 * @return An iterator that points to the inserted element.
508 * This function inserts an element into the %multiset. Contrary
509 * to a std::set the %multiset does not rely on unique keys and thus
510 * multiple copies of the same element can be inserted.
512 * Note that the first parameter is only a hint and can potentially
513 * improve the performance of the insertion process. A bad hint would
514 * cause no gains in efficiency.
516 * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
517 * for more on @a hinting.
519 * Insertion requires logarithmic time (if the hint is not taken).
522 insert(const_iterator __position
, const value_type
& __x
)
523 { return _M_t
._M_insert_equal_(__position
, __x
); }
525 #if __cplusplus >= 201103L
527 insert(const_iterator __position
, value_type
&& __x
)
528 { return _M_t
._M_insert_equal_(__position
, std::move(__x
)); }
532 * @brief A template function that tries to insert a range of elements.
533 * @param __first Iterator pointing to the start of the range to be
535 * @param __last Iterator pointing to the end of the range.
537 * Complexity similar to that of the range constructor.
539 template<typename _InputIterator
>
541 insert(_InputIterator __first
, _InputIterator __last
)
542 { _M_t
._M_insert_equal(__first
, __last
); }
544 #if __cplusplus >= 201103L
546 * @brief Attempts to insert a list of elements into the %multiset.
547 * @param __l A std::initializer_list<value_type> of elements
550 * Complexity similar to that of the range constructor.
553 insert(initializer_list
<value_type
> __l
)
554 { this->insert(__l
.begin(), __l
.end()); }
557 #if __cplusplus >= 201103L
558 // _GLIBCXX_RESOLVE_LIB_DEFECTS
559 // DR 130. Associative erase should return an iterator.
561 * @brief Erases an element from a %multiset.
562 * @param __position An iterator pointing to the element to be erased.
563 * @return An iterator pointing to the element immediately following
564 * @a position prior to the element being erased. If no such
565 * element exists, end() is returned.
567 * This function erases an element, pointed to by the given iterator,
568 * from a %multiset. Note that this function only erases the element,
569 * and that if the element is itself a pointer, the pointed-to memory is
570 * not touched in any way. Managing the pointer is the user's
573 _GLIBCXX_ABI_TAG_CXX11
575 erase(const_iterator __position
)
576 { return _M_t
.erase(__position
); }
579 * @brief Erases an element from a %multiset.
580 * @param __position An iterator pointing to the element to be erased.
582 * This function erases an element, pointed to by the given iterator,
583 * from a %multiset. Note that this function only erases the element,
584 * and that if the element is itself a pointer, the pointed-to memory is
585 * not touched in any way. Managing the pointer is the user's
589 erase(iterator __position
)
590 { _M_t
.erase(__position
); }
594 * @brief Erases elements according to the provided key.
595 * @param __x Key of element to be erased.
596 * @return The number of elements erased.
598 * This function erases all elements located by the given key from a
600 * Note that this function only erases the element, and that if
601 * the element is itself a pointer, the pointed-to memory is not touched
602 * in any way. Managing the pointer is the user's responsibility.
605 erase(const key_type
& __x
)
606 { return _M_t
.erase(__x
); }
608 #if __cplusplus >= 201103L
609 // _GLIBCXX_RESOLVE_LIB_DEFECTS
610 // DR 130. Associative erase should return an iterator.
612 * @brief Erases a [first,last) range of elements from a %multiset.
613 * @param __first Iterator pointing to the start of the range to be
615 * @param __last Iterator pointing to the end of the range to
617 * @return The iterator @a last.
619 * This function erases a sequence of elements from a %multiset.
620 * Note that this function only erases the elements, and that if
621 * the elements themselves are pointers, the pointed-to memory is not
622 * touched in any way. Managing the pointer is the user's
625 _GLIBCXX_ABI_TAG_CXX11
627 erase(const_iterator __first
, const_iterator __last
)
628 { return _M_t
.erase(__first
, __last
); }
631 * @brief Erases a [first,last) range of elements from a %multiset.
632 * @param first Iterator pointing to the start of the range to be
634 * @param last Iterator pointing to the end of the range to be erased.
636 * This function erases a sequence of elements from a %multiset.
637 * Note that this function only erases the elements, and that if
638 * the elements themselves are pointers, the pointed-to memory is not
639 * touched in any way. Managing the pointer is the user's
643 erase(iterator __first
, iterator __last
)
644 { _M_t
.erase(__first
, __last
); }
648 * Erases all elements in a %multiset. Note that this function only
649 * erases the elements, and that if the elements themselves are pointers,
650 * the pointed-to memory is not touched in any way. Managing the pointer
651 * is the user's responsibility.
654 clear() _GLIBCXX_NOEXCEPT
657 // multiset operations:
660 * @brief Finds the number of elements with given key.
661 * @param __x Key of elements to be located.
662 * @return Number of elements with specified key.
665 count(const key_type
& __x
) const
666 { return _M_t
.count(__x
); }
668 // _GLIBCXX_RESOLVE_LIB_DEFECTS
669 // 214. set::find() missing const overload
672 * @brief Tries to locate an element in a %set.
673 * @param __x Element to be located.
674 * @return Iterator pointing to sought-after element, or end() if not
677 * This function takes a key and tries to locate the element with which
678 * the key matches. If successful the function returns an iterator
679 * pointing to the sought after element. If unsuccessful it returns the
680 * past-the-end ( @c end() ) iterator.
683 find(const key_type
& __x
)
684 { return _M_t
.find(__x
); }
687 find(const key_type
& __x
) const
688 { return _M_t
.find(__x
); }
693 * @brief Finds the beginning of a subsequence matching given key.
694 * @param __x Key to be located.
695 * @return Iterator pointing to first element equal to or greater
696 * than key, or end().
698 * This function returns the first element of a subsequence of elements
699 * that matches the given key. If unsuccessful it returns an iterator
700 * pointing to the first element that has a greater value than given key
701 * or end() if no such element exists.
704 lower_bound(const key_type
& __x
)
705 { return _M_t
.lower_bound(__x
); }
708 lower_bound(const key_type
& __x
) const
709 { return _M_t
.lower_bound(__x
); }
714 * @brief Finds the end of a subsequence matching given key.
715 * @param __x Key to be located.
716 * @return Iterator pointing to the first element
717 * greater than key, or end().
720 upper_bound(const key_type
& __x
)
721 { return _M_t
.upper_bound(__x
); }
724 upper_bound(const key_type
& __x
) const
725 { return _M_t
.upper_bound(__x
); }
730 * @brief Finds a subsequence matching given key.
731 * @param __x Key to be located.
732 * @return Pair of iterators that possibly points to the subsequence
733 * matching given key.
735 * This function is equivalent to
737 * std::make_pair(c.lower_bound(val),
738 * c.upper_bound(val))
740 * (but is faster than making the calls separately).
742 * This function probably only makes sense for multisets.
744 std::pair
<iterator
, iterator
>
745 equal_range(const key_type
& __x
)
746 { return _M_t
.equal_range(__x
); }
748 std::pair
<const_iterator
, const_iterator
>
749 equal_range(const key_type
& __x
) const
750 { return _M_t
.equal_range(__x
); }
753 template<typename _K1
, typename _C1
, typename _A1
>
755 operator==(const multiset
<_K1
, _C1
, _A1
>&,
756 const multiset
<_K1
, _C1
, _A1
>&);
758 template<typename _K1
, typename _C1
, typename _A1
>
760 operator< (const multiset
<_K1
, _C1
, _A1
>&,
761 const multiset
<_K1
, _C1
, _A1
>&);
765 * @brief Multiset equality comparison.
766 * @param __x A %multiset.
767 * @param __y A %multiset of the same type as @a __x.
768 * @return True iff the size and elements of the multisets are equal.
770 * This is an equivalence relation. It is linear in the size of the
772 * Multisets are considered equivalent if their sizes are equal, and if
773 * corresponding elements compare equal.
775 template<typename _Key
, typename _Compare
, typename _Alloc
>
777 operator==(const multiset
<_Key
, _Compare
, _Alloc
>& __x
,
778 const multiset
<_Key
, _Compare
, _Alloc
>& __y
)
779 { return __x
._M_t
== __y
._M_t
; }
782 * @brief Multiset ordering relation.
783 * @param __x A %multiset.
784 * @param __y A %multiset of the same type as @a __x.
785 * @return True iff @a __x is lexicographically less than @a __y.
787 * This is a total ordering relation. It is linear in the size of the
788 * sets. The elements must be comparable with @c <.
790 * See std::lexicographical_compare() for how the determination is made.
792 template<typename _Key
, typename _Compare
, typename _Alloc
>
794 operator<(const multiset
<_Key
, _Compare
, _Alloc
>& __x
,
795 const multiset
<_Key
, _Compare
, _Alloc
>& __y
)
796 { return __x
._M_t
< __y
._M_t
; }
798 /// Returns !(x == y).
799 template<typename _Key
, typename _Compare
, typename _Alloc
>
801 operator!=(const multiset
<_Key
, _Compare
, _Alloc
>& __x
,
802 const multiset
<_Key
, _Compare
, _Alloc
>& __y
)
803 { return !(__x
== __y
); }
806 template<typename _Key
, typename _Compare
, typename _Alloc
>
808 operator>(const multiset
<_Key
,_Compare
,_Alloc
>& __x
,
809 const multiset
<_Key
,_Compare
,_Alloc
>& __y
)
810 { return __y
< __x
; }
813 template<typename _Key
, typename _Compare
, typename _Alloc
>
815 operator<=(const multiset
<_Key
, _Compare
, _Alloc
>& __x
,
816 const multiset
<_Key
, _Compare
, _Alloc
>& __y
)
817 { return !(__y
< __x
); }
820 template<typename _Key
, typename _Compare
, typename _Alloc
>
822 operator>=(const multiset
<_Key
, _Compare
, _Alloc
>& __x
,
823 const multiset
<_Key
, _Compare
, _Alloc
>& __y
)
824 { return !(__x
< __y
); }
826 /// See std::multiset::swap().
827 template<typename _Key
, typename _Compare
, typename _Alloc
>
829 swap(multiset
<_Key
, _Compare
, _Alloc
>& __x
,
830 multiset
<_Key
, _Compare
, _Alloc
>& __y
)
833 _GLIBCXX_END_NAMESPACE_CONTAINER
836 #endif /* _STL_MULTISET_H */