stl_multiset.h

Go to the documentation of this file.
00001 // Multiset implementation -*- C++ -*-
00002 
00003 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
00004 // Free Software Foundation, Inc.
00005 //
00006 // This file is part of the GNU ISO C++ Library.  This library is free
00007 // software; you can redistribute it and/or modify it under the
00008 // terms of the GNU General Public License as published by the
00009 // Free Software Foundation; either version 3, or (at your option)
00010 // any later version.
00011 
00012 // This library is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 
00017 // Under Section 7 of GPL version 3, you are granted additional
00018 // permissions described in the GCC Runtime Library Exception, version
00019 // 3.1, as published by the Free Software Foundation.
00020 
00021 // You should have received a copy of the GNU General Public License and
00022 // a copy of the GCC Runtime Library Exception along with this program;
00023 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00024 // <http://www.gnu.org/licenses/>.
00025 
00026 /*
00027  *
00028  * Copyright (c) 1994
00029  * Hewlett-Packard Company
00030  *
00031  * Permission to use, copy, modify, distribute and sell this software
00032  * and its documentation for any purpose is hereby granted without fee,
00033  * provided that the above copyright notice appear in all copies and
00034  * that both that copyright notice and this permission notice appear
00035  * in supporting documentation.  Hewlett-Packard Company makes no
00036  * representations about the suitability of this software for any
00037  * purpose.  It is provided "as is" without express or implied warranty.
00038  *
00039  *
00040  * Copyright (c) 1996
00041  * Silicon Graphics Computer Systems, Inc.
00042  *
00043  * Permission to use, copy, modify, distribute and sell this software
00044  * and its documentation for any purpose is hereby granted without fee,
00045  * provided that the above copyright notice appear in all copies and
00046  * that both that copyright notice and this permission notice appear
00047  * in supporting documentation.  Silicon Graphics makes no
00048  * representations about the suitability of this software for any
00049  * purpose.  It is provided "as is" without express or implied warranty.
00050  */
00051 
00052 /** @file stl_multiset.h
00053  *  This is an internal header file, included by other library headers.
00054  *  You should not attempt to use it directly.
00055  */
00056 
00057 #ifndef _STL_MULTISET_H
00058 #define _STL_MULTISET_H 1
00059 
00060 #include <bits/concept_check.h>
00061 #include <initializer_list>
00062 
00063 _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
00064 
00065   /**
00066    *  @brief A standard container made up of elements, which can be retrieved
00067    *  in logarithmic time.
00068    *
00069    *  @ingroup associative_containers
00070    *
00071    *  Meets the requirements of a <a href="tables.html#65">container</a>, a
00072    *  <a href="tables.html#66">reversible container</a>, and an
00073    *  <a href="tables.html#69">associative container</a> (using equivalent
00074    *  keys).  For a @c multiset<Key> the key_type and value_type are Key.
00075    *
00076    *  Multisets support bidirectional iterators.
00077    *
00078    *  The private tree data is declared exactly the same way for set and
00079    *  multiset; the distinction is made entirely in how the tree functions are
00080    *  called (*_unique versus *_equal, same as the standard).
00081   */
00082   template <typename _Key, typename _Compare = std::less<_Key>,
00083         typename _Alloc = std::allocator<_Key> >
00084     class multiset
00085     {
00086       // concept requirements
00087       typedef typename _Alloc::value_type                   _Alloc_value_type;
00088       __glibcxx_class_requires(_Key, _SGIAssignableConcept)
00089       __glibcxx_class_requires4(_Compare, bool, _Key, _Key,
00090                 _BinaryFunctionConcept)
00091       __glibcxx_class_requires2(_Key, _Alloc_value_type, _SameTypeConcept)  
00092 
00093     public:
00094       // typedefs:
00095       typedef _Key     key_type;
00096       typedef _Key     value_type;
00097       typedef _Compare key_compare;
00098       typedef _Compare value_compare;
00099       typedef _Alloc   allocator_type;
00100 
00101     private:
00102       /// This turns a red-black tree into a [multi]set.
00103       typedef typename _Alloc::template rebind<_Key>::other _Key_alloc_type;
00104 
00105       typedef _Rb_tree<key_type, value_type, _Identity<value_type>,
00106                key_compare, _Key_alloc_type> _Rep_type;
00107       /// The actual tree structure.
00108       _Rep_type _M_t;
00109 
00110     public:
00111       typedef typename _Key_alloc_type::pointer             pointer;
00112       typedef typename _Key_alloc_type::const_pointer       const_pointer;
00113       typedef typename _Key_alloc_type::reference           reference;
00114       typedef typename _Key_alloc_type::const_reference     const_reference;
00115       // _GLIBCXX_RESOLVE_LIB_DEFECTS
00116       // DR 103. set::iterator is required to be modifiable,
00117       // but this allows modification of keys.
00118       typedef typename _Rep_type::const_iterator            iterator;
00119       typedef typename _Rep_type::const_iterator            const_iterator;
00120       typedef typename _Rep_type::const_reverse_iterator    reverse_iterator;
00121       typedef typename _Rep_type::const_reverse_iterator    const_reverse_iterator;
00122       typedef typename _Rep_type::size_type                 size_type;
00123       typedef typename _Rep_type::difference_type           difference_type;
00124 
00125       // allocation/deallocation
00126       /**
00127        *  @brief  Default constructor creates no elements.
00128        */
00129       multiset()
00130       : _M_t() { }
00131 
00132       /**
00133        *  @brief  Creates a %multiset with no elements.
00134        *  @param  comp  Comparator to use.
00135        *  @param  a  An allocator object.
00136        */
00137       explicit
00138       multiset(const _Compare& __comp,
00139            const allocator_type& __a = allocator_type())
00140       : _M_t(__comp, __a) { }
00141 
00142       /**
00143        *  @brief  Builds a %multiset from a range.
00144        *  @param  first  An input iterator.
00145        *  @param  last  An input iterator.
00146        *
00147        *  Create a %multiset consisting of copies of the elements from
00148        *  [first,last).  This is linear in N if the range is already sorted,
00149        *  and NlogN otherwise (where N is distance(first,last)).
00150        */
00151       template<typename _InputIterator>
00152         multiset(_InputIterator __first, _InputIterator __last)
00153     : _M_t()
00154         { _M_t._M_insert_equal(__first, __last); }
00155 
00156       /**
00157        *  @brief  Builds a %multiset from a range.
00158        *  @param  first  An input iterator.
00159        *  @param  last  An input iterator.
00160        *  @param  comp  A comparison functor.
00161        *  @param  a  An allocator object.
00162        *
00163        *  Create a %multiset consisting of copies of the elements from
00164        *  [first,last).  This is linear in N if the range is already sorted,
00165        *  and NlogN otherwise (where N is distance(first,last)).
00166        */
00167       template<typename _InputIterator>
00168         multiset(_InputIterator __first, _InputIterator __last,
00169          const _Compare& __comp,
00170          const allocator_type& __a = allocator_type())
00171     : _M_t(__comp, __a)
00172         { _M_t._M_insert_equal(__first, __last); }
00173 
00174       /**
00175        *  @brief  %Multiset copy constructor.
00176        *  @param  x  A %multiset of identical element and allocator types.
00177        *
00178        *  The newly-created %multiset uses a copy of the allocation object used
00179        *  by @a x.
00180        */
00181       multiset(const multiset& __x)
00182       : _M_t(__x._M_t) { }
00183 
00184 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00185      /**
00186        *  @brief  %Multiset move constructor.
00187        *  @param  x  A %multiset of identical element and allocator types.
00188        *
00189        *  The newly-created %multiset contains the exact contents of @a x.
00190        *  The contents of @a x are a valid, but unspecified %multiset.
00191        */
00192       multiset(multiset&& __x)
00193       : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
00194 
00195       /**
00196        *  @brief  Builds a %multiset from an initializer_list.
00197        *  @param  l  An initializer_list.
00198        *  @param  comp  A comparison functor.
00199        *  @param  a  An allocator object.
00200        *
00201        *  Create a %multiset consisting of copies of the elements from
00202        *  the list.  This is linear in N if the list is already sorted,
00203        *  and NlogN otherwise (where N is @a l.size()).
00204        */
00205       multiset(initializer_list<value_type> __l,
00206            const _Compare& __comp = _Compare(),
00207            const allocator_type& __a = allocator_type())
00208       : _M_t(__comp, __a)
00209       { _M_t._M_insert_equal(__l.begin(), __l.end()); }
00210 #endif
00211 
00212       /**
00213        *  @brief  %Multiset assignment operator.
00214        *  @param  x  A %multiset of identical element and allocator types.
00215        *
00216        *  All the elements of @a x are copied, but unlike the copy constructor,
00217        *  the allocator object is not copied.
00218        */
00219       multiset&
00220       operator=(const multiset& __x)
00221       {
00222     _M_t = __x._M_t;
00223     return *this;
00224       }
00225 
00226 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00227       /**
00228        *  @brief  %Multiset move assignment operator.
00229        *  @param  x  A %multiset of identical element and allocator types.
00230        *
00231        *  The contents of @a x are moved into this %multiset (without copying).
00232        *  @a x is a valid, but unspecified %multiset.
00233        */
00234       multiset&
00235       operator=(multiset&& __x)
00236       {
00237     // NB: DR 675.
00238     this->clear();
00239     this->swap(__x); 
00240     return *this;
00241       }
00242 
00243       /**
00244        *  @brief  %Multiset list assignment operator.
00245        *  @param  l  An initializer_list.
00246        *
00247        *  This function fills a %multiset with copies of the elements in the
00248        *  initializer list @a l.
00249        *
00250        *  Note that the assignment completely changes the %multiset and
00251        *  that the resulting %multiset's size is the same as the number
00252        *  of elements assigned.  Old data may be lost.
00253        */
00254       multiset&
00255       operator=(initializer_list<value_type> __l)
00256       {
00257     this->clear();
00258     this->insert(__l.begin(), __l.end());
00259     return *this;
00260       }
00261 #endif
00262 
00263       // accessors:
00264 
00265       ///  Returns the comparison object.
00266       key_compare
00267       key_comp() const
00268       { return _M_t.key_comp(); }
00269       ///  Returns the comparison object.
00270       value_compare
00271       value_comp() const
00272       { return _M_t.key_comp(); }
00273       ///  Returns the memory allocation object.
00274       allocator_type
00275       get_allocator() const
00276       { return _M_t.get_allocator(); }
00277 
00278       /**
00279        *  Returns a read-only (constant) iterator that points to the first
00280        *  element in the %multiset.  Iteration is done in ascending order
00281        *  according to the keys.
00282        */
00283       iterator
00284       begin() const
00285       { return _M_t.begin(); }
00286 
00287       /**
00288        *  Returns a read-only (constant) iterator that points one past the last
00289        *  element in the %multiset.  Iteration is done in ascending order
00290        *  according to the keys.
00291        */
00292       iterator
00293       end() const
00294       { return _M_t.end(); }
00295 
00296       /**
00297        *  Returns a read-only (constant) reverse iterator that points to the
00298        *  last element in the %multiset.  Iteration is done in descending order
00299        *  according to the keys.
00300        */
00301       reverse_iterator
00302       rbegin() const
00303       { return _M_t.rbegin(); }
00304 
00305       /**
00306        *  Returns a read-only (constant) reverse iterator that points to the
00307        *  last element in the %multiset.  Iteration is done in descending order
00308        *  according to the keys.
00309        */
00310       reverse_iterator
00311       rend() const
00312       { return _M_t.rend(); }
00313 
00314 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00315       /**
00316        *  Returns a read-only (constant) iterator that points to the first
00317        *  element in the %multiset.  Iteration is done in ascending order
00318        *  according to the keys.
00319        */
00320       iterator
00321       cbegin() const
00322       { return _M_t.begin(); }
00323 
00324       /**
00325        *  Returns a read-only (constant) iterator that points one past the last
00326        *  element in the %multiset.  Iteration is done in ascending order
00327        *  according to the keys.
00328        */
00329       iterator
00330       cend() const
00331       { return _M_t.end(); }
00332 
00333       /**
00334        *  Returns a read-only (constant) reverse iterator that points to the
00335        *  last element in the %multiset.  Iteration is done in descending order
00336        *  according to the keys.
00337        */
00338       reverse_iterator
00339       crbegin() const
00340       { return _M_t.rbegin(); }
00341 
00342       /**
00343        *  Returns a read-only (constant) reverse iterator that points to the
00344        *  last element in the %multiset.  Iteration is done in descending order
00345        *  according to the keys.
00346        */
00347       reverse_iterator
00348       crend() const
00349       { return _M_t.rend(); }
00350 #endif
00351 
00352       ///  Returns true if the %set is empty.
00353       bool
00354       empty() const
00355       { return _M_t.empty(); }
00356 
00357       ///  Returns the size of the %set.
00358       size_type
00359       size() const
00360       { return _M_t.size(); }
00361 
00362       ///  Returns the maximum size of the %set.
00363       size_type
00364       max_size() const
00365       { return _M_t.max_size(); }
00366 
00367       /**
00368        *  @brief  Swaps data with another %multiset.
00369        *  @param  x  A %multiset of the same element and allocator types.
00370        *
00371        *  This exchanges the elements between two multisets in constant time.
00372        *  (It is only swapping a pointer, an integer, and an instance of the @c
00373        *  Compare type (which itself is often stateless and empty), so it should
00374        *  be quite fast.)
00375        *  Note that the global std::swap() function is specialized such that
00376        *  std::swap(s1,s2) will feed to this function.
00377        */
00378       void
00379 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00380       swap(multiset&& __x)
00381 #else
00382       swap(multiset& __x)
00383 #endif
00384       { _M_t.swap(__x._M_t); }
00385 
00386       // insert/erase
00387       /**
00388        *  @brief Inserts an element into the %multiset.
00389        *  @param  x  Element to be inserted.
00390        *  @return An iterator that points to the inserted element.
00391        *
00392        *  This function inserts an element into the %multiset.  Contrary
00393        *  to a std::set the %multiset does not rely on unique keys and thus
00394        *  multiple copies of the same element can be inserted.
00395        *
00396        *  Insertion requires logarithmic time.
00397        */
00398       iterator
00399       insert(const value_type& __x)
00400       { return _M_t._M_insert_equal(__x); }
00401 
00402       /**
00403        *  @brief Inserts an element into the %multiset.
00404        *  @param  position  An iterator that serves as a hint as to where the
00405        *                    element should be inserted.
00406        *  @param  x  Element to be inserted.
00407        *  @return An iterator that points to the inserted element.
00408        *
00409        *  This function inserts an element into the %multiset.  Contrary
00410        *  to a std::set the %multiset does not rely on unique keys and thus
00411        *  multiple copies of the same element can be inserted.
00412        *
00413        *  Note that the first parameter is only a hint and can potentially
00414        *  improve the performance of the insertion process.  A bad hint would
00415        *  cause no gains in efficiency.
00416        *
00417        *  See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html
00418        *  for more on "hinting".
00419        *
00420        *  Insertion requires logarithmic time (if the hint is not taken).
00421        */
00422       iterator
00423       insert(iterator __position, const value_type& __x)
00424       { return _M_t._M_insert_equal_(__position, __x); }
00425 
00426       /**
00427        *  @brief A template function that attempts to insert a range of elements.
00428        *  @param  first  Iterator pointing to the start of the range to be
00429        *                 inserted.
00430        *  @param  last  Iterator pointing to the end of the range.
00431        *
00432        *  Complexity similar to that of the range constructor.
00433        */
00434       template<typename _InputIterator>
00435         void
00436         insert(_InputIterator __first, _InputIterator __last)
00437         { _M_t._M_insert_equal(__first, __last); }
00438 
00439 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00440       /**
00441        *  @brief Attempts to insert a list of elements into the %multiset.
00442        *  @param  list  A std::initializer_list<value_type> of elements
00443        *                to be inserted.
00444        *
00445        *  Complexity similar to that of the range constructor.
00446        */
00447       void
00448       insert(initializer_list<value_type> __l)
00449       { this->insert(__l.begin(), __l.end()); }
00450 #endif
00451 
00452       /**
00453        *  @brief Erases an element from a %multiset.
00454        *  @param  position  An iterator pointing to the element to be erased.
00455        *
00456        *  This function erases an element, pointed to by the given iterator,
00457        *  from a %multiset.  Note that this function only erases the element,
00458        *  and that if the element is itself a pointer, the pointed-to memory is
00459        *  not touched in any way.  Managing the pointer is the user's
00460        *  responsibility.
00461        */
00462       void
00463       erase(iterator __position)
00464       { _M_t.erase(__position); }
00465 
00466       /**
00467        *  @brief Erases elements according to the provided key.
00468        *  @param  x  Key of element to be erased.
00469        *  @return  The number of elements erased.
00470        *
00471        *  This function erases all elements located by the given key from a
00472        *  %multiset.
00473        *  Note that this function only erases the element, and that if
00474        *  the element is itself a pointer, the pointed-to memory is not touched
00475        *  in any way.  Managing the pointer is the user's responsibility.
00476        */
00477       size_type
00478       erase(const key_type& __x)
00479       { return _M_t.erase(__x); }
00480 
00481       /**
00482        *  @brief Erases a [first,last) range of elements from a %multiset.
00483        *  @param  first  Iterator pointing to the start of the range to be
00484        *                 erased.
00485        *  @param  last  Iterator pointing to the end of the range to be erased.
00486        *
00487        *  This function erases a sequence of elements from a %multiset.
00488        *  Note that this function only erases the elements, and that if
00489        *  the elements themselves are pointers, the pointed-to memory is not
00490        *  touched in any way.  Managing the pointer is the user's responsibility.
00491        */
00492       void
00493       erase(iterator __first, iterator __last)
00494       { _M_t.erase(__first, __last); }
00495 
00496       /**
00497        *  Erases all elements in a %multiset.  Note that this function only
00498        *  erases the elements, and that if the elements themselves are pointers,
00499        *  the pointed-to memory is not touched in any way.  Managing the pointer
00500        *  is the user's responsibility.
00501        */
00502       void
00503       clear()
00504       { _M_t.clear(); }
00505 
00506       // multiset operations:
00507 
00508       /**
00509        *  @brief Finds the number of elements with given key.
00510        *  @param  x  Key of elements to be located.
00511        *  @return Number of elements with specified key.
00512        */
00513       size_type
00514       count(const key_type& __x) const
00515       { return _M_t.count(__x); }
00516 
00517       // _GLIBCXX_RESOLVE_LIB_DEFECTS
00518       // 214.  set::find() missing const overload
00519       //@{
00520       /**
00521        *  @brief Tries to locate an element in a %set.
00522        *  @param  x  Element to be located.
00523        *  @return  Iterator pointing to sought-after element, or end() if not
00524        *           found.
00525        *
00526        *  This function takes a key and tries to locate the element with which
00527        *  the key matches.  If successful the function returns an iterator
00528        *  pointing to the sought after element.  If unsuccessful it returns the
00529        *  past-the-end ( @c end() ) iterator.
00530        */
00531       iterator
00532       find(const key_type& __x)
00533       { return _M_t.find(__x); }
00534 
00535       const_iterator
00536       find(const key_type& __x) const
00537       { return _M_t.find(__x); }
00538       //@}
00539 
00540       //@{
00541       /**
00542        *  @brief Finds the beginning of a subsequence matching given key.
00543        *  @param  x  Key to be located.
00544        *  @return  Iterator pointing to first element equal to or greater
00545        *           than key, or end().
00546        *
00547        *  This function returns the first element of a subsequence of elements
00548        *  that matches the given key.  If unsuccessful it returns an iterator
00549        *  pointing to the first element that has a greater value than given key
00550        *  or end() if no such element exists.
00551        */
00552       iterator
00553       lower_bound(const key_type& __x)
00554       { return _M_t.lower_bound(__x); }
00555 
00556       const_iterator
00557       lower_bound(const key_type& __x) const
00558       { return _M_t.lower_bound(__x); }
00559       //@}
00560 
00561       //@{
00562       /**
00563        *  @brief Finds the end of a subsequence matching given key.
00564        *  @param  x  Key to be located.
00565        *  @return Iterator pointing to the first element
00566        *          greater than key, or end().
00567        */
00568       iterator
00569       upper_bound(const key_type& __x)
00570       { return _M_t.upper_bound(__x); }
00571 
00572       const_iterator
00573       upper_bound(const key_type& __x) const
00574       { return _M_t.upper_bound(__x); }
00575       //@}
00576 
00577       //@{
00578       /**
00579        *  @brief Finds a subsequence matching given key.
00580        *  @param  x  Key to be located.
00581        *  @return  Pair of iterators that possibly points to the subsequence
00582        *           matching given key.
00583        *
00584        *  This function is equivalent to
00585        *  @code
00586        *    std::make_pair(c.lower_bound(val),
00587        *                   c.upper_bound(val))
00588        *  @endcode
00589        *  (but is faster than making the calls separately).
00590        *
00591        *  This function probably only makes sense for multisets.
00592        */
00593       std::pair<iterator, iterator>
00594       equal_range(const key_type& __x)
00595       { return _M_t.equal_range(__x); }
00596 
00597       std::pair<const_iterator, const_iterator>
00598       equal_range(const key_type& __x) const
00599       { return _M_t.equal_range(__x); }
00600 
00601       template<typename _K1, typename _C1, typename _A1>
00602         friend bool
00603         operator==(const multiset<_K1, _C1, _A1>&,
00604            const multiset<_K1, _C1, _A1>&);
00605 
00606       template<typename _K1, typename _C1, typename _A1>
00607         friend bool
00608         operator< (const multiset<_K1, _C1, _A1>&,
00609            const multiset<_K1, _C1, _A1>&);
00610     };
00611 
00612   /**
00613    *  @brief  Multiset equality comparison.
00614    *  @param  x  A %multiset.
00615    *  @param  y  A %multiset of the same type as @a x.
00616    *  @return  True iff the size and elements of the multisets are equal.
00617    *
00618    *  This is an equivalence relation.  It is linear in the size of the
00619    *  multisets.
00620    *  Multisets are considered equivalent if their sizes are equal, and if
00621    *  corresponding elements compare equal.
00622   */
00623   template<typename _Key, typename _Compare, typename _Alloc>
00624     inline bool
00625     operator==(const multiset<_Key, _Compare, _Alloc>& __x,
00626            const multiset<_Key, _Compare, _Alloc>& __y)
00627     { return __x._M_t == __y._M_t; }
00628 
00629   /**
00630    *  @brief  Multiset ordering relation.
00631    *  @param  x  A %multiset.
00632    *  @param  y  A %multiset of the same type as @a x.
00633    *  @return  True iff @a x is lexicographically less than @a y.
00634    *
00635    *  This is a total ordering relation.  It is linear in the size of the
00636    *  maps.  The elements must be comparable with @c <.
00637    *
00638    *  See std::lexicographical_compare() for how the determination is made.
00639   */
00640   template<typename _Key, typename _Compare, typename _Alloc>
00641     inline bool
00642     operator<(const multiset<_Key, _Compare, _Alloc>& __x,
00643           const multiset<_Key, _Compare, _Alloc>& __y)
00644     { return __x._M_t < __y._M_t; }
00645 
00646   ///  Returns !(x == y).
00647   template<typename _Key, typename _Compare, typename _Alloc>
00648     inline bool
00649     operator!=(const multiset<_Key, _Compare, _Alloc>& __x,
00650            const multiset<_Key, _Compare, _Alloc>& __y)
00651     { return !(__x == __y); }
00652 
00653   ///  Returns y < x.
00654   template<typename _Key, typename _Compare, typename _Alloc>
00655     inline bool
00656     operator>(const multiset<_Key,_Compare,_Alloc>& __x,
00657           const multiset<_Key,_Compare,_Alloc>& __y)
00658     { return __y < __x; }
00659 
00660   ///  Returns !(y < x)
00661   template<typename _Key, typename _Compare, typename _Alloc>
00662     inline bool
00663     operator<=(const multiset<_Key, _Compare, _Alloc>& __x,
00664            const multiset<_Key, _Compare, _Alloc>& __y)
00665     { return !(__y < __x); }
00666 
00667   ///  Returns !(x < y)
00668   template<typename _Key, typename _Compare, typename _Alloc>
00669     inline bool
00670     operator>=(const multiset<_Key, _Compare, _Alloc>& __x,
00671            const multiset<_Key, _Compare, _Alloc>& __y)
00672     { return !(__x < __y); }
00673 
00674   /// See std::multiset::swap().
00675   template<typename _Key, typename _Compare, typename _Alloc>
00676     inline void
00677     swap(multiset<_Key, _Compare, _Alloc>& __x,
00678      multiset<_Key, _Compare, _Alloc>& __y)
00679     { __x.swap(__y); }
00680 
00681 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00682   template<typename _Key, typename _Compare, typename _Alloc>
00683     inline void
00684     swap(multiset<_Key, _Compare, _Alloc>&& __x,
00685      multiset<_Key, _Compare, _Alloc>& __y)
00686     { __x.swap(__y); }
00687 
00688   template<typename _Key, typename _Compare, typename _Alloc>
00689     inline void
00690     swap(multiset<_Key, _Compare, _Alloc>& __x,
00691      multiset<_Key, _Compare, _Alloc>&& __y)
00692     { __x.swap(__y); }
00693 #endif
00694 
00695 _GLIBCXX_END_NESTED_NAMESPACE
00696 
00697 #endif /* _STL_MULTISET_H */

Generated on Thu Jul 23 21:16:22 2009 for libstdc++ by  doxygen 1.5.8