// -*- C++ -*-
#ifndef __STD_SET__
#define __STD_SET__

/***************************************************************************
 *
 * set - declarations for the Standard Library set class
 *
 ***************************************************************************
 *    
 *  Copyright 2000 Compaq Computer Corporation
 *
 *  COMPAQ Registered in U.S. Patent and Trademark Office.
 *
 *  Confidential computer software. Valid license from Compaq required for
 *  possession, use or copying. Consistent with FAR 12.211 and 12.212,
 *  Commercial Computer Software, Computer Software Documentation, and
 *  Technical Data for Commercial Items are licensed to the U.S. Government
 *  under vendor's standard commercial license.
 *
 ****************************************************************************
 *
 * Copyright (c) 1994
 * Hewlett-Packard Company
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Hewlett-Packard Company makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 *
 *
 ***************************************************************************
 *
 * (c) Copyright 1994, 1998 Rogue Wave Software, Inc.
 * ALL RIGHTS RESERVED
 *
 * The software and information contained herein are proprietary to, and
 * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
 * intends to preserve as trade secrets such software and information.
 * This software is furnished pursuant to a written license agreement and
 * may be used, copied, transmitted, and stored only in accordance with
 * the terms of such license and with the inclusion of the above copyright
 * notice.  This software and information or any other copies thereof may
 * not be provided or otherwise made available to any other person.
 *
 * Notwithstanding any other lease or license that may pertain to, or
 * accompany the delivery of, this computer software and information, the
 * rights of the Government regarding its use, reproduction and disclosure
 * are as set forth in Section 52.227-19 of the FARS Computer
 * Software-Restricted Rights clause.
 * 
 * Use, duplication, or disclosure by the Government is subject to
 * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
 * Technical Data and Computer Software clause at DFARS 252.227-7013.
 * Contractor/Manufacturer is Rogue Wave Software, Inc.,
 * P.O. Box 2328, Corvallis, Oregon 97339.
 *
 * This computer software and information is distributed with "restricted
 * rights."  Use, duplication or disclosure is subject to restrictions as
 * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
 * Computer Software-Restricted Rights (April 1985)."  If the Clause at
 * 18-52.227-74 "Rights in Data General" is specified in the contract,
 * then the "Alternate III" clause applies.
 *
 **************************************************************************/

#include <stdcomp>

#ifdef __BORLANDC__
#pragma option -w-inl
#endif

#include <memory>
#include <functional>
#include <tree>


#if defined(__DECCXX)
#   ifdef __PRAGMA_ENVIRONMENT
#      pragma __environment __save
#      pragma __environment __cxx_header_defaults
#   endif
#endif

#if defined(__VMS) && defined(__DECCXX) && !defined(__DECFIXCXXL1158)
#pragma __extern_prefix __save
#pragma __extern_prefix "CXXL$" 
#endif


#ifndef _RWSTD_NO_NAMESPACE
namespace _RWrwstd {
#endif

//
// This is used in the implementation of set and multiset.
//

  template <class T, class U>
  struct _RWident : public _RW_STD::unary_function<T, U>
  {
    const U& operator() (const T& x) const { return x; }
  };

#ifndef _RWSTD_NO_NAMESPACE
} namespace std {
#endif

//
// Note that _RWSTD_COMPLEX_DEFAULT(x)
// will expand to: ' = x', or nothing,
// depending on your compiler's capabilities and/or
// flag settings (see stdcomp.h).
//
  template <class Key, 
  class Compare _RWSTD_COMPLEX_DEFAULT(less<Key>), 
  class Allocator _RWSTD_COMPLEX_DEFAULT(allocator<Key>) >  
  class set
  {
  public:
    //
    // Types
    //
    typedef Key                key_type;
    typedef Key                value_type;
    typedef Compare            key_compare;
    typedef Compare            value_compare;
    typedef Allocator          allocator_type;

  private:
    
    typedef __RWSTD::_RWrb_tree<key_type, value_type, 
    __RWSTD::_RWident<value_type, key_type>, 
    key_compare, allocator_type> _RWrep_type;
    _RWrep_type _RWt;

  public:
    //
    // Types
    //
    typedef _TYPENAME _RWrep_type::reference               reference;
    typedef _TYPENAME _RWrep_type::const_reference         const_reference;
#if defined(__DECCXX) && !defined(__DECFIXCXXL1634)
    typedef _TYPENAME _RWrep_type::const_iterator          iterator;
#else
    typedef _TYPENAME _RWrep_type::iterator                iterator;
#endif
    typedef _TYPENAME _RWrep_type::const_iterator          const_iterator;
    typedef _TYPENAME _RWrep_type::size_type               size_type;
    typedef _TYPENAME _RWrep_type::difference_type         difference_type;
    typedef _TYPENAME _RWrep_type::pointer                 pointer;
    typedef _TYPENAME _RWrep_type::const_pointer           const_pointer;
    typedef _TYPENAME _RWrep_type::reverse_iterator        reverse_iterator;
    typedef _TYPENAME _RWrep_type::const_reverse_iterator  const_reverse_iterator;

    //
    // construct/copy/destroy
    //
    _EXPLICIT set (const Compare& comp _RWSTD_DEFAULT_ARG(Compare()),
                   const Allocator& alloc _RWSTD_DEFAULT_ARG(Allocator())) : _RWt(comp, false, alloc) {}

#ifdef _RWSTD_NO_DEFAULT_TEMPLATE_ARGS
    set () : _RWt(Compare(), false, Allocator()) {}

    _EXPLICIT set (const Compare& comp _RWSTD_DEFAULT_ARG(Compare())) : _RWt(comp, false, Allocator()) {}
#endif

#ifndef _RWSTD_NO_MEMBER_TEMPLATES
    template<class InputIterator>
    set (InputIterator first, InputIterator last,
         const Compare& comp = Compare(),
         const Allocator& alloc = Allocator()) : _RWt(comp, false, alloc)
    {
      while (first != last) _RWt.insert(*first++);
    }
#else
    set (const value_type* first, const value_type* last,
         const Compare& comp _RWSTD_DEFAULT_ARG(Compare()),
         const Allocator& alloc _RWSTD_DEFAULT_ARG(Allocator())) : _RWt(comp, false, alloc)
    {
      while (first != last) _RWt.insert(*first++);
    }
    
    set (const_iterator first, const_iterator last,
         const Compare& comp _RWSTD_DEFAULT_ARG(Compare()),
         const Allocator& alloc _RWSTD_DEFAULT_ARG(Allocator())) : _RWt(comp, false, alloc)
    {
      while (first != last) _RWt.insert(*first++);
    }

#ifdef _RWSTD_NO_DEFAULT_TEMPLATE_ARGS
    set (const value_type* first, const value_type* last) : _RWt(Compare(), false, Allocator())
    {
      while (first != last) _RWt.insert(*first++);
    }
    
    set (const value_type* first, const value_type* last,
         const Compare& comp _RWSTD_DEFAULT_ARG(Compare())) : _RWt(comp, false, Allocator())
    {
      while (first != last) _RWt.insert(*first++);
    }
    
    set (const_iterator first, const_iterator last) : _RWt(Compare(), false, Allocator())
    {
      while (first != last) _RWt.insert(*first++);
    }

    set (const_iterator first, const_iterator last,
         const Compare& comp _RWSTD_DEFAULT_ARG(Compare())) : _RWt(comp, false, Allocator())
    {
      while (first != last) _RWt.insert(*first++);
    }
#endif
#endif

    set (const set<Key, Compare, Allocator>& x) : _RWt(x._RWt, false) {}
    set<Key, Compare, Allocator>& operator= (const set<Key, Compare, Allocator>& x)
    {
      _RWt = x._RWt; return *this;
    }
    allocator_type get_allocator() const
    {
      return _RWt.get_allocator();
    }

    //
    // iterators
    //
    iterator                 begin  ()       { return _RWt.begin();  }
    const_iterator           begin  () const { return _RWt.begin();  }
    iterator                 end    ()       { return _RWt.end();    }
    const_iterator           end    () const { return _RWt.end();    }
    reverse_iterator         rbegin ()       { return _RWt.rbegin(); } 
    const_reverse_iterator   rbegin () const { return _RWt.rbegin(); } 
    reverse_iterator         rend   ()       { return _RWt.rend();   }
    const_reverse_iterator   rend   () const { return _RWt.rend();   }

    //
    // capacity
    //
    bool        empty    () const { return _RWt.empty();    }
    size_type   size     () const { return _RWt.size();     }
    size_type   max_size () const { return _RWt.max_size(); }

    //
    // modifiers
    //
#ifdef _RWSTD_NO_MEMBER_TYPE_TPARAM
    typedef _TYPENAME _RWrep_type::iterator t_iterator;
#endif
#ifndef _RWSTD_NO_RET_TEMPLATE
    pair<iterator,bool> insert (const value_type& x)
#else
      typedef pair<iterator, bool> pair_iterator_bool;
      //
      // typedef done to get around compiler bug.
      //
      pair_iterator_bool insert (const value_type& x)
#endif
    {
#ifndef _RWSTD_NO_MEMBER_TYPE_TPARAM
      pair<_TYPENAME _RWrep_type::iterator, bool> p = _RWt.insert(x); 
#else
      pair<t_iterator,bool> p = _RWt.insert(x); 
#endif
      return pair<iterator, bool>(p.first, p.second);
    }
    iterator insert (iterator position, const value_type& x)
    {
      return _RWt.insert(_RWSTD_REINTERPRET_CAST(_TYPENAME _RWrep_type::iterator&,position), x);
    }

#ifndef _RWSTD_NO_MEMBER_TEMPLATES
    template<class InputIterator>
    void insert (InputIterator first, InputIterator last)
    {
      while (first != last) _RWt.insert(*first++);
    }
#else
    void insert (const value_type* first, const value_type* last)
    {
      while (first != last) _RWt.insert(*first++);
    }
    void insert (const_iterator first, const_iterator last)
    {
      while (first != last) _RWt.insert(*first++);
    }
#endif

    void erase (iterator position)
    {
      _RWt.erase(_RWSTD_REINTERPRET_CAST(_TYPENAME _RWrep_type::iterator&,position));
    }
    size_type erase (const key_type& x)
    {
      return _RWt.erase(x); 
    }
    void erase (iterator first, iterator last)
    {
      _RWt.erase(_RWSTD_REINTERPRET_CAST(_TYPENAME _RWrep_type::iterator&,first),
                       _RWSTD_REINTERPRET_CAST(_TYPENAME _RWrep_type::iterator&,last));
    }
    void swap (set<Key, Compare, Allocator>& x) { _RWt.swap(x._RWt); }
    void clear ()   { erase(begin(),end()); }

    //
    // observers
    //
    key_compare        key_comp   () const { return _RWt.key_comp(); }
    value_compare      value_comp () const { return _RWt.key_comp(); }

    //
    // set operations
    //
#if defined(__DECCXX) && !defined(__DECFIXCXXL1309)
    iterator  find        (const key_type& x) { return _RWt.find(x);       }
    const_iterator  find        (const key_type& x) const { return _RWt.find(x);       }
#else
    iterator  find        (const key_type& x) const { return _RWt.find(x);       }
#endif
    size_type count       (const key_type& x) const { return _RWt.count(x);      }
#if defined(__DECCXX) && !defined(__DECFIXCXXL1309)
    iterator  lower_bound (const key_type& x) { return _RWt.lower_bound(x);}
    const_iterator  lower_bound (const key_type& x) const { return _RWt.lower_bound(x);}
#else
    iterator  lower_bound (const key_type& x) const { return _RWt.lower_bound(x);}
#endif

#if defined(__DECCXX) && !defined(__DECFIXCXXL1309)
    iterator  upper_bound (const key_type& x) { return _RWt.upper_bound(x);}
    const_iterator  upper_bound (const key_type& x) const { return _RWt.upper_bound(x);}
#else
    iterator  upper_bound (const key_type& x) const { return _RWt.upper_bound(x);}
#endif

#ifndef _RWSTD_NO_RET_TEMPLATE

#if defined(__DECCXX) && !defined(__DECFIXCXXL1309)
    pair<iterator,iterator> equal_range(const key_type& x) 
#else
    pair<iterator,iterator> equal_range(const key_type& x) const
#endif

#else
      typedef  pair<iterator, iterator> pair_iterator_iterator;
    //
    // typedef done to get around compiler bug
    //
#if defined(__DECCXX) && !defined(__DECFIXCXXL1309)
    pair_iterator_iterator equal_range (const key_type& x) 
#else
    pair_iterator_iterator equal_range (const key_type& x) const
#endif

#endif
    {
      return _RWt.equal_range(x);
    }


#if defined(__DECCXX) && !defined(__DECFIXCXXL1309)

#ifndef _RWSTD_NO_RET_TEMPLATE
    pair<const iterator,const iterator> equal_range(const key_type& x) const
#else
    typedef pair<const_iterator, const_iterator> pair_citerator_citerator;
    //
    // typedef done to get around compiler bug
    //
    pair_citerator_citerator equal_range (const key_type& x) const 
#endif
    {
      return _RWt.equal_range(x);
    }

#endif

#ifndef _RWSTD_STRICT_ANSI
    // Non-standard function for setting buffer allocation size
    size_type allocation_size() { return _RWt.allocation_size(); }
    size_type allocation_size(size_type new_size) 
    { 
      return _RWt.allocation_size(new_size);
    }
#endif  
  };

//
// Note that _RWSTD_COMPLEX_DEFAULT(x)
// will expand to: ' = x', or nothing,
// depending on your compiler's capabilities and/or
// flag settings (see stdcomp.h).
//
  template <class Key, 
  class Compare _RWSTD_COMPLEX_DEFAULT(less<Key>), 
  class Allocator _RWSTD_COMPLEX_DEFAULT(allocator<Key>) > 
  class multiset
  {
  public:
    //  
    // types
    //
    typedef Key       key_type;
    typedef Key       value_type;
    typedef Compare   key_compare;
    typedef Compare   value_compare;
    typedef Allocator allocator_type;
  private:
    
    typedef __RWSTD::_RWrb_tree<key_type, value_type, 
      __RWSTD::_RWident<value_type, key_type>, 
      key_compare, allocator_type> _RWrep_type;
    _RWrep_type _RWt;

  public:
    //
    // types
    //
    typedef _TYPENAME _RWrep_type::reference               reference;
    typedef _TYPENAME _RWrep_type::const_reference         const_reference;
#if defined(__DECCXX) && !defined(__DECFIXCXXL1634)
    typedef _TYPENAME _RWrep_type::const_iterator          iterator;
#else
    typedef _TYPENAME _RWrep_type::iterator                iterator;
#endif
    typedef _TYPENAME _RWrep_type::const_iterator          const_iterator;
    typedef _TYPENAME _RWrep_type::size_type               size_type;
    typedef _TYPENAME _RWrep_type::difference_type         difference_type;
    typedef _TYPENAME _RWrep_type::pointer                 pointer;
    typedef _TYPENAME _RWrep_type::const_pointer           const_pointer;
    typedef _TYPENAME _RWrep_type::reverse_iterator        reverse_iterator;
    typedef _TYPENAME _RWrep_type::const_reverse_iterator  const_reverse_iterator;

    //
    // construct/copy/destroy
    //
    _EXPLICIT multiset (const Compare& comp _RWSTD_DEFAULT_ARG(Compare()),
                        const Allocator& alloc _RWSTD_DEFAULT_ARG(Allocator())) : _RWt(comp, true, alloc) {}

#ifdef _RWSTD_NO_DEFAULT_TEMPLATE_ARGS
    _EXPLICIT multiset (void) : _RWt(Compare(), true, Allocator()) {}

    _EXPLICIT multiset (const Compare& comp _RWSTD_DEFAULT_ARG(Compare())) : _RWt(comp, true, Allocator()) {}
#endif

#ifndef _RWSTD_NO_MEMBER_TEMPLATES
    template<class InputIterator>
    multiset (InputIterator first, InputIterator last, 
              const Compare& comp _RWSTD_DEFAULT_ARG(Compare()),
              const Allocator& alloc _RWSTD_DEFAULT_ARG(Allocator())) : _RWt(comp, true, alloc)
    {
      while (first != last) _RWt.insert(*first++);
    }
#else
    multiset (const value_type* first, const value_type* last, 
              const Compare& comp _RWSTD_DEFAULT_ARG(Compare()),
              const Allocator& alloc _RWSTD_DEFAULT_ARG(Allocator())) : _RWt(comp, true, alloc)
    {
      while (first != last) _RWt.insert(*first++);
    }
    multiset (const_iterator first, const_iterator last, 
              const Compare& comp _RWSTD_DEFAULT_ARG(Compare()),
              const Allocator& alloc _RWSTD_DEFAULT_ARG(Allocator())) : _RWt(comp, true, alloc)
    {
      while (first != last) _RWt.insert(*first++);
    }

#ifdef _RWSTD_NO_DEFAULT_TEMPLATE_ARGS
    multiset (const value_type* first, const value_type* last) : _RWt(Compare(), true, Allocator())
    {
      while (first != last) _RWt.insert(*first++);
    }

    multiset (const value_type* first, const value_type* last, 
              const Compare& comp _RWSTD_DEFAULT_ARG(Compare())) : _RWt(comp, true, Allocator())
    {
      while (first != last) _RWt.insert(*first++);
    }

    multiset (const_iterator first, const_iterator last) : _RWt(Compare(), true, Allocator())
    {
      while (first != last) _RWt.insert(*first++);
    }

    multiset (const_iterator first, const_iterator last, 
              const Compare& comp _RWSTD_DEFAULT_ARG(Compare())) : _RWt(comp, true, Allocator())
    {
      while (first != last) _RWt.insert(*first++);
    }
#endif

#endif

    multiset (const multiset<Key, Compare, Allocator>& x) : _RWt(x._RWt, true) {}
    multiset<Key, Compare, Allocator>& 
    operator= (const multiset<Key, Compare, Allocator>& x)
    {
      _RWt = x._RWt; return *this;
    }
    allocator_type get_allocator() const
    {
      return _RWt.get_allocator();
    }

    //
    // iterators
    //
    iterator                 begin  ()       { return _RWt.begin();  }
    const_iterator           begin  () const { return _RWt.begin();  }
    iterator                 end    ()       { return _RWt.end();    }
    const_iterator           end    () const { return _RWt.end();    }
    reverse_iterator         rbegin ()       { return _RWt.rbegin(); } 
    const_reverse_iterator   rbegin () const { return _RWt.rbegin(); } 
    reverse_iterator         rend   ()       { return _RWt.rend();   }
    const_reverse_iterator   rend   () const { return _RWt.rend();   }

    //
    // capacity
    //
    bool       empty    () const { return _RWt.empty();    }
    size_type  size     () const { return _RWt.size();     }
    size_type  max_size () const { return _RWt.max_size(); }

    //
    // modifiers
    //
    iterator insert (const value_type& x) { return _RWt.insert(x).first; }
    iterator insert (iterator position, const value_type& x)
    {
      return _RWt.insert(_RWSTD_REINTERPRET_CAST(_TYPENAME _RWrep_type::iterator&,position), x);
    }

#ifndef _RWSTD_NO_MEMBER_TEMPLATES
    template<class InputIterator>
    void insert (InputIterator first, InputIterator last)
    {
      while (first != last) _RWt.insert(*first++);
    }
#else
    void insert (const value_type* first, const value_type* last)
    {
      while (first != last) _RWt.insert(*first++);
    }
    void insert (const_iterator first, const_iterator last)
    {
      while (first != last) _RWt.insert(*first++);
    }
#endif

    void erase (iterator position)
    {
      _RWt.erase(_RWSTD_REINTERPRET_CAST(_TYPENAME _RWrep_type::iterator&,position));
    }
    size_type erase (const key_type& x) { return _RWt.erase(x); }
    void erase (iterator first, iterator last)
    {
      _RWt.erase(_RWSTD_REINTERPRET_CAST(_TYPENAME _RWrep_type::iterator&,first),
                       _RWSTD_REINTERPRET_CAST(_TYPENAME _RWrep_type::iterator&,last)); 
    }
    void swap (multiset<Key, Compare, Allocator>& x) { _RWt.swap(x._RWt); }
    void clear ()   { erase(begin(),end()); }

    //
    // observers
    //
    key_compare   key_comp   () const { return _RWt.key_comp(); }
    value_compare value_comp () const { return _RWt.key_comp(); }

    //
    // set operations
    //
    iterator  find        (const key_type& x) const { return _RWt.find(x);  }
    size_type count       (const key_type& x) const { return _RWt.count(x); }
    iterator  lower_bound (const key_type& x) const
    {
      return _RWt.lower_bound(x);
    }
    iterator  upper_bound (const key_type& x) const
    {
      return _RWt.upper_bound(x); 
    }
#ifndef _RWSTD_NO_RET_TEMPLATE
    pair<iterator,iterator> equal_range (const key_type& x) const
#else
      typedef  pair<iterator, iterator> pair_iterator_iterator; 
    //
    // typedef done to get around compiler bug
    //
    pair_iterator_iterator equal_range (const key_type& x) const
#endif
    {
      return _RWt.equal_range(x);
    }

#ifndef _RWSTD_STRICT_ANSI
    // Non-standard function for setting buffer allocation size
    size_type allocation_size() { return _RWt.allocation_size(); }
    size_type allocation_size(size_type new_size) 
    { 
      return _RWt.allocation_size(new_size);
    }
#endif  
  };

  template <class Key, class Compare, class Allocator>
  inline bool operator== (const set<Key, Compare, Allocator>& x, 
                          const set<Key, Compare, Allocator>& y)
  {
    return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
  }

  template <class Key, class Compare, class Allocator>
  inline bool operator< (const set<Key, Compare, Allocator>& x, 
                         const set<Key, Compare, Allocator>& y)
  {
    return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
  }

#if !defined(_RWSTD_NO_NAMESPACE) || !defined(_RWSTD_NO_PART_SPEC_OVERLOAD)
  template <class Key, class Compare, class Allocator>
  inline bool operator!= (const set<Key,Compare,Allocator>& x, 
                          const set<Key,Compare,Allocator>& y)
  {
    return !(x == y);
  }

  template <class Key, class Compare, class Allocator>
  inline bool operator> (const set<Key,Compare,Allocator>& x, 
                         const set<Key,Compare,Allocator>& y)
  {
    return y < x;
  }

  template <class Key, class Compare, class Allocator>
  inline bool operator>= (const set<Key,Compare,Allocator>& x, 
                          const set<Key,Compare,Allocator>& y)
  {
    return !(x < y);
  }

  template <class Key, class Compare, class Allocator>
  inline bool operator<= (const set<Key,Compare,Allocator>& x, 
                          const set<Key,Compare,Allocator>& y)
  {
    return !(y <  x);
  }

  template <class Key, class Compare, class Allocator>
  void swap(set<Key,Compare,Allocator>& a, 
            set<Key,Compare,Allocator>& b)
  {
    a.swap(b);
  }
#endif

  template <class Key, class Compare, class Allocator>
  inline bool operator== (const multiset<Key, Compare, Allocator>& x, 
                          const multiset<Key, Compare, Allocator>& y)
  {
    return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
  }

  template <class Key, class Compare, class Allocator>
  inline bool operator< (const multiset<Key, Compare, Allocator>& x, 
                         const multiset<Key, Compare, Allocator>& y)
  {
    return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
  }

#if !defined(_RWSTD_NO_NAMESPACE) || !defined(_RWSTD_NO_PART_SPEC_OVERLOAD)
  template <class Key, class Compare, class Allocator>
  inline bool operator!= (const multiset<Key,Compare,Allocator>& x, 
                          const multiset<Key,Compare,Allocator>& y)
  {
    return !(x == y);
  }

  template <class Key, class Compare, class Allocator>
  inline bool operator> (const multiset<Key,Compare,Allocator>& x, 
                         const multiset<Key,Compare,Allocator>& y)
  {
    return y < x;
  }

  template <class Key, class Compare, class Allocator>
  inline bool operator>= (const multiset<Key,Compare,Allocator>& x, 
                          const multiset<Key,Compare,Allocator>& y)
  {
    return !(x < y);
  }

  template <class Key, class Compare, class Allocator>
  inline bool operator<= (const multiset<Key,Compare,Allocator>& x, 
                          const multiset<Key,Compare,Allocator>& y)
  {
    return !(y <  x);
  }

  template <class Key, class Compare, class Allocator>
  void swap(multiset<Key,Compare,Allocator>& a, 
            multiset<Key,Compare,Allocator>& b)
  {
    a.swap(b);
  }
#endif

#ifndef _RWSTD_NO_NAMESPACE
}
#endif

#if defined(__VMS) && defined(__DECCXX) && !defined(__DECFIXCXXL1158)
#   pragma __extern_prefix __restore
#endif

#if defined(__DECCXX)
#   ifdef __PRAGMA_ENVIRONMENT
#      pragma __environment __restore
#   endif
#endif

#endif
