OSDN Git Service

bb84b6b7d08dc8736af599d118b5ebf82cab117e
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / bits / stl_multiset.h
1 // Multiset implementation -*- C++ -*-
2
3 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4 // Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library.  This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
16
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
20
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24 // <http://www.gnu.org/licenses/>.
25
26 /*
27  *
28  * Copyright (c) 1994
29  * Hewlett-Packard Company
30  *
31  * Permission to use, copy, modify, distribute and sell this software
32  * and its documentation for any purpose is hereby granted without fee,
33  * provided that the above copyright notice appear in all copies and
34  * that both that copyright notice and this permission notice appear
35  * in supporting documentation.  Hewlett-Packard Company makes no
36  * representations about the suitability of this software for any
37  * purpose.  It is provided "as is" without express or implied warranty.
38  *
39  *
40  * Copyright (c) 1996
41  * Silicon Graphics Computer Systems, Inc.
42  *
43  * Permission to use, copy, modify, distribute and sell this software
44  * and its documentation for any purpose is hereby granted without fee,
45  * provided that the above copyright notice appear in all copies and
46  * that both that copyright notice and this permission notice appear
47  * in supporting documentation.  Silicon Graphics makes no
48  * representations about the suitability of this software for any
49  * purpose.  It is provided "as is" without express or implied warranty.
50  */
51
52 /** @file stl_multiset.h
53  *  This is an internal header file, included by other library headers.
54  *  You should not attempt to use it directly.
55  */
56
57 #ifndef _STL_MULTISET_H
58 #define _STL_MULTISET_H 1
59
60 #include <bits/concept_check.h>
61 #include <initializer_list>
62
63 _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
64
65   /**
66    *  @brief A standard container made up of elements, which can be retrieved
67    *  in logarithmic time.
68    *
69    *  @ingroup associative_containers
70    *
71    *  Meets the requirements of a <a href="tables.html#65">container</a>, a
72    *  <a href="tables.html#66">reversible container</a>, and an
73    *  <a href="tables.html#69">associative container</a> (using equivalent
74    *  keys).  For a @c multiset<Key> the key_type and value_type are Key.
75    *
76    *  Multisets support bidirectional iterators.
77    *
78    *  The private tree data is declared exactly the same way for set and
79    *  multiset; the distinction is made entirely in how the tree functions are
80    *  called (*_unique versus *_equal, same as the standard).
81   */
82   template <typename _Key, typename _Compare = std::less<_Key>,
83             typename _Alloc = std::allocator<_Key> >
84     class multiset
85     {
86       // concept requirements
87       typedef typename _Alloc::value_type                   _Alloc_value_type;
88       __glibcxx_class_requires(_Key, _SGIAssignableConcept)
89       __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
90                                 _BinaryFunctionConcept)
91       __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)      
92
93     public:
94       // typedefs:
95       typedef _Key     key_type;
96       typedef _Key     value_type;
97       typedef _Compare key_compare;
98       typedef _Compare value_compare;
99       typedef _Alloc   allocator_type;
100
101     private:
102       /// This turns a red-black tree into a [multi]set.
103       typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
104
105       typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
106                        key_compare, _Key_alloc_type> _Rep_type;
107       /// The actual tree structure.
108       _Rep_type _M_t;
109
110     public:
111       typedef typename _Key_alloc_type::pointer             pointer;
112       typedef typename _Key_alloc_type::const_pointer       const_pointer;
113       typedef typename _Key_alloc_type::reference           reference;
114       typedef typename _Key_alloc_type::const_reference     const_reference;
115       // _GLIBCXX_RESOLVE_LIB_DEFECTS
116       // DR 103. set::iterator is required to be modifiable,
117       // but this allows modification of keys.
118       typedef typename _Rep_type::const_iterator            iterator;
119       typedef typename _Rep_type::const_iterator            const_iterator;
120       typedef typename _Rep_type::const_reverse_iterator    reverse_iterator;
121       typedef typename _Rep_type::const_reverse_iterator    const_reverse_iterator;
122       typedef typename _Rep_type::size_type                 size_type;
123       typedef typename _Rep_type::difference_type           difference_type;
124
125       // allocation/deallocation
126       /**
127        *  @brief  Default constructor creates no elements.
128        */
129       multiset()
130       : _M_t() { }
131
132       /**
133        *  @brief  Creates a %multiset with no elements.
134        *  @param  comp  Comparator to use.
135        *  @param  a  An allocator object.
136        */
137       explicit
138       multiset(const _Compare& __comp,
139                const allocator_type& __a = allocator_type())
140       : _M_t(__comp, __a) { }
141
142       /**
143        *  @brief  Builds a %multiset from a range.
144        *  @param  first  An input iterator.
145        *  @param  last  An input iterator.
146        *
147        *  Create a %multiset consisting of copies of the elements from
148        *  [first,last).  This is linear in N if the range is already sorted,
149        *  and NlogN otherwise (where N is distance(first,last)).
150        */
151       template<typename _InputIterator>
152         multiset(_InputIterator __first, _InputIterator __last)
153         : _M_t()
154         { _M_t._M_insert_equal(__first, __last); }
155
156       /**
157        *  @brief  Builds a %multiset from a range.
158        *  @param  first  An input iterator.
159        *  @param  last  An input iterator.
160        *  @param  comp  A comparison functor.
161        *  @param  a  An allocator object.
162        *
163        *  Create a %multiset consisting of copies of the elements from
164        *  [first,last).  This is linear in N if the range is already sorted,
165        *  and NlogN otherwise (where N is distance(first,last)).
166        */
167       template<typename _InputIterator>
168         multiset(_InputIterator __first, _InputIterator __last,
169                  const _Compare& __comp,
170                  const allocator_type& __a = allocator_type())
171         : _M_t(__comp, __a)
172         { _M_t._M_insert_equal(__first, __last); }
173
174       /**
175        *  @brief  %Multiset copy constructor.
176        *  @param  x  A %multiset of identical element and allocator types.
177        *
178        *  The newly-created %multiset uses a copy of the allocation object used
179        *  by @a x.
180        */
181       multiset(const multiset& __x)
182       : _M_t(__x._M_t) { }
183
184 #ifdef __GXX_EXPERIMENTAL_CXX0X__
185      /**
186        *  @brief  %Multiset move constructor.
187        *  @param  x  A %multiset of identical element and allocator types.
188        *
189        *  The newly-created %multiset contains the exact contents of @a x.
190        *  The contents of @a x are a valid, but unspecified %multiset.
191        */
192       multiset(multiset&& __x)
193       : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
194
195       /**
196        *  @brief  Builds a %multiset from an initializer_list.
197        *  @param  l  An initializer_list.
198        *  @param  comp  A comparison functor.
199        *  @param  a  An allocator object.
200        *
201        *  Create a %multiset consisting of copies of the elements from
202        *  the list.  This is linear in N if the list is already sorted,
203        *  and NlogN otherwise (where N is @a l.size()).
204        */
205       multiset(initializer_list<value_type> __l,
206                const _Compare& __comp = _Compare(),
207                const allocator_type& __a = allocator_type())
208       : _M_t(__comp, __a)
209       { _M_t._M_insert_equal(__l.begin(), __l.end()); }
210 #endif
211
212       /**
213        *  @brief  %Multiset assignment operator.
214        *  @param  x  A %multiset of identical element and allocator types.
215        *
216        *  All the elements of @a x are copied, but unlike the copy constructor,
217        *  the allocator object is not copied.
218        */
219       multiset&
220       operator=(const multiset& __x)
221       {
222         _M_t = __x._M_t;
223         return *this;
224       }
225
226 #ifdef __GXX_EXPERIMENTAL_CXX0X__
227       /**
228        *  @brief  %Multiset move assignment operator.
229        *  @param  x  A %multiset of identical element and allocator types.
230        *
231        *  The contents of @a x are moved into this %multiset (without copying).
232        *  @a x is a valid, but unspecified %multiset.
233        */
234       multiset&
235       operator=(multiset&& __x)
236       {
237         if (this != &__x)
238           {
239             // NB: DR 675.
240             this->clear();
241             this->swap(__x);
242           }
243         return *this;
244       }
245
246       /**
247        *  @brief  %Multiset list assignment operator.
248        *  @param  l  An initializer_list.
249        *
250        *  This function fills a %multiset with copies of the elements in the
251        *  initializer list @a l.
252        *
253        *  Note that the assignment completely changes the %multiset and
254        *  that the resulting %multiset's size is the same as the number
255        *  of elements assigned.  Old data may be lost.
256        */
257       multiset&
258       operator=(initializer_list<value_type> __l)
259       {
260         this->clear();
261         this->insert(__l.begin(), __l.end());
262         return *this;
263       }
264 #endif
265
266       // accessors:
267
268       ///  Returns the comparison object.
269       key_compare
270       key_comp() const
271       { return _M_t.key_comp(); }
272       ///  Returns the comparison object.
273       value_compare
274       value_comp() const
275       { return _M_t.key_comp(); }
276       ///  Returns the memory allocation object.
277       allocator_type
278       get_allocator() const
279       { return _M_t.get_allocator(); }
280
281       /**
282        *  Returns a read-only (constant) iterator that points to the first
283        *  element in the %multiset.  Iteration is done in ascending order
284        *  according to the keys.
285        */
286       iterator
287       begin() const
288       { return _M_t.begin(); }
289
290       /**
291        *  Returns a read-only (constant) iterator that points one past the last
292        *  element in the %multiset.  Iteration is done in ascending order
293        *  according to the keys.
294        */
295       iterator
296       end() const
297       { return _M_t.end(); }
298
299       /**
300        *  Returns a read-only (constant) reverse iterator that points to the
301        *  last element in the %multiset.  Iteration is done in descending order
302        *  according to the keys.
303        */
304       reverse_iterator
305       rbegin() const
306       { return _M_t.rbegin(); }
307
308       /**
309        *  Returns a read-only (constant) reverse iterator that points to the
310        *  last element in the %multiset.  Iteration is done in descending order
311        *  according to the keys.
312        */
313       reverse_iterator
314       rend() const
315       { return _M_t.rend(); }
316
317 #ifdef __GXX_EXPERIMENTAL_CXX0X__
318       /**
319        *  Returns a read-only (constant) iterator that points to the first
320        *  element in the %multiset.  Iteration is done in ascending order
321        *  according to the keys.
322        */
323       iterator
324       cbegin() const
325       { return _M_t.begin(); }
326
327       /**
328        *  Returns a read-only (constant) iterator that points one past the last
329        *  element in the %multiset.  Iteration is done in ascending order
330        *  according to the keys.
331        */
332       iterator
333       cend() const
334       { return _M_t.end(); }
335
336       /**
337        *  Returns a read-only (constant) reverse iterator that points to the
338        *  last element in the %multiset.  Iteration is done in descending order
339        *  according to the keys.
340        */
341       reverse_iterator
342       crbegin() const
343       { return _M_t.rbegin(); }
344
345       /**
346        *  Returns a read-only (constant) reverse iterator that points to the
347        *  last element in the %multiset.  Iteration is done in descending order
348        *  according to the keys.
349        */
350       reverse_iterator
351       crend() const
352       { return _M_t.rend(); }
353 #endif
354
355       ///  Returns true if the %set is empty.
356       bool
357       empty() const
358       { return _M_t.empty(); }
359
360       ///  Returns the size of the %set.
361       size_type
362       size() const
363       { return _M_t.size(); }
364
365       ///  Returns the maximum size of the %set.
366       size_type
367       max_size() const
368       { return _M_t.max_size(); }
369
370       /**
371        *  @brief  Swaps data with another %multiset.
372        *  @param  x  A %multiset of the same element and allocator types.
373        *
374        *  This exchanges the elements between two multisets in constant time.
375        *  (It is only swapping a pointer, an integer, and an instance of the @c
376        *  Compare type (which itself is often stateless and empty), so it should
377        *  be quite fast.)
378        *  Note that the global std::swap() function is specialized such that
379        *  std::swap(s1,s2) will feed to this function.
380        */
381       void
382       swap(multiset& __x)
383       { _M_t.swap(__x._M_t); }
384
385       // insert/erase
386       /**
387        *  @brief Inserts an element into the %multiset.
388        *  @param  x  Element to be inserted.
389        *  @return An iterator that points to the inserted element.
390        *
391        *  This function inserts an element into the %multiset.  Contrary
392        *  to a std::set the %multiset does not rely on unique keys and thus
393        *  multiple copies of the same element can be inserted.
394        *
395        *  Insertion requires logarithmic time.
396        */
397       iterator
398       insert(const value_type& __x)
399       { return _M_t._M_insert_equal(__x); }
400
401       /**
402        *  @brief Inserts an element into the %multiset.
403        *  @param  position  An iterator that serves as a hint as to where the
404        *                    element should be inserted.
405        *  @param  x  Element to be inserted.
406        *  @return An iterator that points to the inserted element.
407        *
408        *  This function inserts an element into the %multiset.  Contrary
409        *  to a std::set the %multiset does not rely on unique keys and thus
410        *  multiple copies of the same element can be inserted.
411        *
412        *  Note that the first parameter is only a hint and can potentially
413        *  improve the performance of the insertion process.  A bad hint would
414        *  cause no gains in efficiency.
415        *
416        *  See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
417        *  for more on "hinting".
418        *
419        *  Insertion requires logarithmic time (if the hint is not taken).
420        */
421       iterator
422       insert(iterator __position, const value_type& __x)
423       { return _M_t._M_insert_equal_(__position, __x); }
424
425       /**
426        *  @brief A template function that attempts to insert a range of elements.
427        *  @param  first  Iterator pointing to the start of the range to be
428        *                 inserted.
429        *  @param  last  Iterator pointing to the end of the range.
430        *
431        *  Complexity similar to that of the range constructor.
432        */
433       template<typename _InputIterator>
434         void
435         insert(_InputIterator __first, _InputIterator __last)
436         { _M_t._M_insert_equal(__first, __last); }
437
438 #ifdef __GXX_EXPERIMENTAL_CXX0X__
439       /**
440        *  @brief Attempts to insert a list of elements into the %multiset.
441        *  @param  list  A std::initializer_list<value_type> of elements
442        *                to be inserted.
443        *
444        *  Complexity similar to that of the range constructor.
445        */
446       void
447       insert(initializer_list<value_type> __l)
448       { this->insert(__l.begin(), __l.end()); }
449 #endif
450
451 #ifdef __GXX_EXPERIMENTAL_CXX0X__
452       // _GLIBCXX_RESOLVE_LIB_DEFECTS
453       // DR 130. Associative erase should return an iterator.
454       /**
455        *  @brief Erases an element from a %multiset.
456        *  @param  position  An iterator pointing to the element to be erased.
457        *  @return An iterator pointing to the element immediately following
458        *          @a position prior to the element being erased. If no such 
459        *          element exists, end() is returned.
460        *
461        *  This function erases an element, pointed to by the given iterator,
462        *  from a %multiset.  Note that this function only erases the element,
463        *  and that if the element is itself a pointer, the pointed-to memory is
464        *  not touched in any way.  Managing the pointer is the user's
465        *  responsibility.
466        */
467       iterator
468       erase(iterator __position)
469       { return _M_t.erase(__position); }
470 #else
471       /**
472        *  @brief Erases an element from a %multiset.
473        *  @param  position  An iterator pointing to the element to be erased.
474        *
475        *  This function erases an element, pointed to by the given iterator,
476        *  from a %multiset.  Note that this function only erases the element,
477        *  and that if the element is itself a pointer, the pointed-to memory is
478        *  not touched in any way.  Managing the pointer is the user's
479        *  responsibility.
480        */
481       void
482       erase(iterator __position)
483       { _M_t.erase(__position); }
484 #endif
485
486       /**
487        *  @brief Erases elements according to the provided key.
488        *  @param  x  Key of element to be erased.
489        *  @return  The number of elements erased.
490        *
491        *  This function erases all elements located by the given key from a
492        *  %multiset.
493        *  Note that this function only erases the element, and that if
494        *  the element is itself a pointer, the pointed-to memory is not touched
495        *  in any way.  Managing the pointer is the user's responsibility.
496        */
497       size_type
498       erase(const key_type& __x)
499       { return _M_t.erase(__x); }
500
501 #ifdef __GXX_EXPERIMENTAL_CXX0X__
502       // _GLIBCXX_RESOLVE_LIB_DEFECTS
503       // DR 130. Associative erase should return an iterator.
504       /**
505        *  @brief Erases a [first,last) range of elements from a %multiset.
506        *  @param  first  Iterator pointing to the start of the range to be
507        *                 erased.
508        *  @param  last  Iterator pointing to the end of the range to be erased.
509        *  @return The iterator @a last.
510        *
511        *  This function erases a sequence of elements from a %multiset.
512        *  Note that this function only erases the elements, and that if
513        *  the elements themselves are pointers, the pointed-to memory is not
514        *  touched in any way.  Managing the pointer is the user's responsibility.
515        */
516       iterator
517       erase(iterator __first, iterator __last)
518       { return _M_t.erase(__first, __last); }
519 #else
520       /**
521        *  @brief Erases a [first,last) range of elements from a %multiset.
522        *  @param  first  Iterator pointing to the start of the range to be
523        *                 erased.
524        *  @param  last  Iterator pointing to the end of the range to be erased.
525        *
526        *  This function erases a sequence of elements from a %multiset.
527        *  Note that this function only erases the elements, and that if
528        *  the elements themselves are pointers, the pointed-to memory is not
529        *  touched in any way.  Managing the pointer is the user's responsibility.
530        */
531       void
532       erase(iterator __first, iterator __last)
533       { _M_t.erase(__first, __last); }
534 #endif
535
536       /**
537        *  Erases all elements in a %multiset.  Note that this function only
538        *  erases the elements, and that if the elements themselves are pointers,
539        *  the pointed-to memory is not touched in any way.  Managing the pointer
540        *  is the user's responsibility.
541        */
542       void
543       clear()
544       { _M_t.clear(); }
545
546       // multiset operations:
547
548       /**
549        *  @brief Finds the number of elements with given key.
550        *  @param  x  Key of elements to be located.
551        *  @return Number of elements with specified key.
552        */
553       size_type
554       count(const key_type& __x) const
555       { return _M_t.count(__x); }
556
557       // _GLIBCXX_RESOLVE_LIB_DEFECTS
558       // 214.  set::find() missing const overload
559       //@{
560       /**
561        *  @brief Tries to locate an element in a %set.
562        *  @param  x  Element to be located.
563        *  @return  Iterator pointing to sought-after element, or end() if not
564        *           found.
565        *
566        *  This function takes a key and tries to locate the element with which
567        *  the key matches.  If successful the function returns an iterator
568        *  pointing to the sought after element.  If unsuccessful it returns the
569        *  past-the-end ( @c end() ) iterator.
570        */
571       iterator
572       find(const key_type& __x)
573       { return _M_t.find(__x); }
574
575       const_iterator
576       find(const key_type& __x) const
577       { return _M_t.find(__x); }
578       //@}
579
580       //@{
581       /**
582        *  @brief Finds the beginning of a subsequence matching given key.
583        *  @param  x  Key to be located.
584        *  @return  Iterator pointing to first element equal to or greater
585        *           than key, or end().
586        *
587        *  This function returns the first element of a subsequence of elements
588        *  that matches the given key.  If unsuccessful it returns an iterator
589        *  pointing to the first element that has a greater value than given key
590        *  or end() if no such element exists.
591        */
592       iterator
593       lower_bound(const key_type& __x)
594       { return _M_t.lower_bound(__x); }
595
596       const_iterator
597       lower_bound(const key_type& __x) const
598       { return _M_t.lower_bound(__x); }
599       //@}
600
601       //@{
602       /**
603        *  @brief Finds the end of a subsequence matching given key.
604        *  @param  x  Key to be located.
605        *  @return Iterator pointing to the first element
606        *          greater than key, or end().
607        */
608       iterator
609       upper_bound(const key_type& __x)
610       { return _M_t.upper_bound(__x); }
611
612       const_iterator
613       upper_bound(const key_type& __x) const
614       { return _M_t.upper_bound(__x); }
615       //@}
616
617       //@{
618       /**
619        *  @brief Finds a subsequence matching given key.
620        *  @param  x  Key to be located.
621        *  @return  Pair of iterators that possibly points to the subsequence
622        *           matching given key.
623        *
624        *  This function is equivalent to
625        *  @code
626        *    std::make_pair(c.lower_bound(val),
627        *                   c.upper_bound(val))
628        *  @endcode
629        *  (but is faster than making the calls separately).
630        *
631        *  This function probably only makes sense for multisets.
632        */
633       std::pair<iterator, iterator>
634       equal_range(const key_type& __x)
635       { return _M_t.equal_range(__x); }
636
637       std::pair<const_iterator, const_iterator>
638       equal_range(const key_type& __x) const
639       { return _M_t.equal_range(__x); }
640
641       template<typename _K1, typename _C1, typename _A1>
642         friend bool
643         operator==(const multiset<_K1, _C1, _A1>&,
644                    const multiset<_K1, _C1, _A1>&);
645
646       template<typename _K1, typename _C1, typename _A1>
647         friend bool
648         operator< (const multiset<_K1, _C1, _A1>&,
649                    const multiset<_K1, _C1, _A1>&);
650     };
651
652   /**
653    *  @brief  Multiset equality comparison.
654    *  @param  x  A %multiset.
655    *  @param  y  A %multiset of the same type as @a x.
656    *  @return  True iff the size and elements of the multisets are equal.
657    *
658    *  This is an equivalence relation.  It is linear in the size of the
659    *  multisets.
660    *  Multisets are considered equivalent if their sizes are equal, and if
661    *  corresponding elements compare equal.
662   */
663   template<typename _Key, typename _Compare, typename _Alloc>
664     inline bool
665     operator==(const multiset<_Key, _Compare, _Alloc>& __x,
666                const multiset<_Key, _Compare, _Alloc>& __y)
667     { return __x._M_t == __y._M_t; }
668
669   /**
670    *  @brief  Multiset ordering relation.
671    *  @param  x  A %multiset.
672    *  @param  y  A %multiset of the same type as @a x.
673    *  @return  True iff @a x is lexicographically less than @a y.
674    *
675    *  This is a total ordering relation.  It is linear in the size of the
676    *  maps.  The elements must be comparable with @c <.
677    *
678    *  See std::lexicographical_compare() for how the determination is made.
679   */
680   template<typename _Key, typename _Compare, typename _Alloc>
681     inline bool
682     operator<(const multiset<_Key, _Compare, _Alloc>& __x,
683               const multiset<_Key, _Compare, _Alloc>& __y)
684     { return __x._M_t < __y._M_t; }
685
686   ///  Returns !(x == y).
687   template<typename _Key, typename _Compare, typename _Alloc>
688     inline bool
689     operator!=(const multiset<_Key, _Compare, _Alloc>& __x,
690                const multiset<_Key, _Compare, _Alloc>& __y)
691     { return !(__x == __y); }
692
693   ///  Returns y < x.
694   template<typename _Key, typename _Compare, typename _Alloc>
695     inline bool
696     operator>(const multiset<_Key,_Compare,_Alloc>& __x,
697               const multiset<_Key,_Compare,_Alloc>& __y)
698     { return __y < __x; }
699
700   ///  Returns !(y < x)
701   template<typename _Key, typename _Compare, typename _Alloc>
702     inline bool
703     operator<=(const multiset<_Key, _Compare, _Alloc>& __x,
704                const multiset<_Key, _Compare, _Alloc>& __y)
705     { return !(__y < __x); }
706
707   ///  Returns !(x < y)
708   template<typename _Key, typename _Compare, typename _Alloc>
709     inline bool
710     operator>=(const multiset<_Key, _Compare, _Alloc>& __x,
711                const multiset<_Key, _Compare, _Alloc>& __y)
712     { return !(__x < __y); }
713
714   /// See std::multiset::swap().
715   template<typename _Key, typename _Compare, typename _Alloc>
716     inline void
717     swap(multiset<_Key, _Compare, _Alloc>& __x,
718          multiset<_Key, _Compare, _Alloc>& __y)
719     { __x.swap(__y); }
720
721 _GLIBCXX_END_NESTED_NAMESPACE
722
723 #endif /* _STL_MULTISET_H */