Quick Links:

bal | bbl | bdl | bsl

Classes | Typedefs | Functions | Variables

Component bslstl_multiset
[Package bslstl]

Provide an STL-compliant multiset class. More...

Classes

class  bsl::multiset< KEY, COMPARATOR, ALLOCATOR >
class  bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::DataWrapper

Typedefs

typedef KEY bsl::multiset::key_type
typedef KEY bsl::multiset::value_type
typedef COMPARATOR bsl::multiset::key_compare
typedef COMPARATOR bsl::multiset::value_compare
typedef ALLOCATOR bsl::multiset::allocator_type
typedef value_type & bsl::multiset::reference
typedef const value_type & bsl::multiset::const_reference
typedef AllocatorTraits::size_type bsl::multiset::size_type
typedef
AllocatorTraits::difference_type 
bsl::multiset::difference_type
typedef AllocatorTraits::pointer bsl::multiset::pointer
typedef
AllocatorTraits::const_pointer 
bsl::multiset::const_pointer
typedef
BloombergLP::bslstl::TreeIterator
< const value_type, Node,
difference_type > 
bsl::multiset::iterator
typedef
BloombergLP::bslstl::TreeIterator
< const value_type, Node,
difference_type > 
bsl::multiset::const_iterator
typedef bsl::reverse_iterator
< iterator > 
bsl::multiset::reverse_iterator
typedef bsl::reverse_iterator
< const_iterator > 
bsl::multiset::const_reverse_iterator

Functions

 bsl::multiset::DataWrapper::DataWrapper (const COMPARATOR &comparator, const ALLOCATOR &basicAllocator)
 bsl::multiset::DataWrapper::DataWrapper (BloombergLP::bslmf::MovableRef< DataWrapper > original)
NodeFactory & bsl::multiset::DataWrapper::nodeFactory ()
const NodeFactory & bsl::multiset::DataWrapper::nodeFactory () const
 bsl::multiset::multiset ()
 bsl::multiset::multiset (const COMPARATOR &comparator, const ALLOCATOR &basicAllocator=ALLOCATOR())
 bsl::multiset::multiset (const ALLOCATOR &basicAllocator)
 bsl::multiset::multiset (const multiset &original)
 bsl::multiset::multiset (BloombergLP::bslmf::MovableRef< multiset > original)
 bsl::multiset::multiset (const multiset &original, const typename type_identity< ALLOCATOR >::type &basicAllocator)
 bsl::multiset::multiset (BloombergLP::bslmf::MovableRef< multiset > original, const typename type_identity< ALLOCATOR >::type &basicAllocator)
template<class INPUT_ITERATOR >
 bsl::multiset::multiset (INPUT_ITERATOR first, INPUT_ITERATOR last, const COMPARATOR &comparator=COMPARATOR(), const ALLOCATOR &basicAllocator=ALLOCATOR())
template<class INPUT_ITERATOR >
 bsl::multiset::multiset (INPUT_ITERATOR first, INPUT_ITERATOR last, const ALLOCATOR &basicAllocator)
 bsl::multiset::multiset (std::initializer_list< KEY > values, const COMPARATOR &comparator=COMPARATOR(), const ALLOCATOR &basicAllocator=ALLOCATOR())
 bsl::multiset::multiset (std::initializer_list< KEY > values, const ALLOCATOR &basicAllocator)
 bsl::multiset::~multiset ()
multiset & bsl::multiset::operator= (const multiset &rhs)
multiset &operator=(BloombergLP::bslmf::MovableRef
< multiset > rhs)
BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits
multiset & 
bsl::multiset::operator= (std::initializer_list< KEY > values)
iterator bsl::multiset::begin () BSLS_KEYWORD_NOEXCEPT
iterator bsl::multiset::end () BSLS_KEYWORD_NOEXCEPT
reverse_iterator bsl::multiset::rbegin () BSLS_KEYWORD_NOEXCEPT
reverse_iterator bsl::multiset::rend () BSLS_KEYWORD_NOEXCEPT
iterator bsl::multiset::insert (const value_type &value)
iterator bsl::multiset::insert (BloombergLP::bslmf::MovableRef< value_type > value)
iterator bsl::multiset::insert (const_iterator hint, const value_type &value)
iterator bsl::multiset::insert (const_iterator hint, BloombergLP::bslmf::MovableRef< value_type > value)
template<class INPUT_ITERATOR >
void bsl::multiset::insert (INPUT_ITERATOR first, INPUT_ITERATOR last)
void bsl::multiset::insert (std::initializer_list< KEY > values)
template<class... Args>
iterator bsl::multiset::emplace (Args &&...args)
template<class... Args>
iterator bsl::multiset::emplace_hint (const_iterator hint, Args &&...args)
iterator bsl::multiset::erase (const_iterator position)
size_type bsl::multiset::erase (const key_type &key)
iterator bsl::multiset::erase (const_iterator first, const_iterator last)
iterator bsl::multiset::find (const key_type &key)
template<class LOOKUP_KEY >
bsl::enable_if
< BloombergLP::bslmf::IsTransparentPredicate
< COMPARATOR, LOOKUP_KEY >
::value, iterator >::type 
bsl::multiset::find (const LOOKUP_KEY &key)
iterator bsl::multiset::lower_bound (const key_type &key)
template<class LOOKUP_KEY >
bsl::enable_if
< BloombergLP::bslmf::IsTransparentPredicate
< COMPARATOR, LOOKUP_KEY >
::value, iterator >::type 
bsl::multiset::lower_bound (const LOOKUP_KEY &key)
iterator bsl::multiset::upper_bound (const key_type &key)
template<class LOOKUP_KEY >
bsl::enable_if
< BloombergLP::bslmf::IsTransparentPredicate
< COMPARATOR, LOOKUP_KEY >
::value, iterator >::type 
bsl::multiset::upper_bound (const LOOKUP_KEY &key)
pair< iterator, iterator > bsl::multiset::equal_range (const key_type &key)
template<class LOOKUP_KEY >
bsl::enable_if
< BloombergLP::bslmf::IsTransparentPredicate
< COMPARATOR, LOOKUP_KEY >
::value, pair< iterator,
iterator > >::type 
bsl::multiset::equal_range (const LOOKUP_KEY &key)
allocator_type bsl::multiset::get_allocator () const BSLS_KEYWORD_NOEXCEPT
const_iterator bsl::multiset::begin () const BSLS_KEYWORD_NOEXCEPT
const_iterator bsl::multiset::end () const BSLS_KEYWORD_NOEXCEPT
const_reverse_iterator bsl::multiset::rbegin () const BSLS_KEYWORD_NOEXCEPT
const_reverse_iterator bsl::multiset::rend () const BSLS_KEYWORD_NOEXCEPT
const_iterator bsl::multiset::cbegin () const BSLS_KEYWORD_NOEXCEPT
const_iterator bsl::multiset::cend () const BSLS_KEYWORD_NOEXCEPT
const_reverse_iterator bsl::multiset::crbegin () const BSLS_KEYWORD_NOEXCEPT
const_reverse_iterator bsl::multiset::crend () const BSLS_KEYWORD_NOEXCEPT
bool bsl::multiset::empty () const BSLS_KEYWORD_NOEXCEPT
size_type bsl::multiset::size () const BSLS_KEYWORD_NOEXCEPT
size_type bsl::multiset::max_size () const BSLS_KEYWORD_NOEXCEPT
key_compare bsl::multiset::key_comp () const
value_compare bsl::multiset::value_comp () const
const_iterator bsl::multiset::find (const key_type &key) const
template<class LOOKUP_KEY >
bsl::enable_if
< BloombergLP::bslmf::IsTransparentPredicate
< COMPARATOR, LOOKUP_KEY >
::value, const_iterator >
::type 
bsl::multiset::find (const LOOKUP_KEY &key) const
size_type bsl::multiset::count (const key_type &key) const
template<class LOOKUP_KEY >
bsl::enable_if
< BloombergLP::bslmf::IsTransparentPredicate
< COMPARATOR, LOOKUP_KEY >
::value, size_type >::type 
bsl::multiset::count (const LOOKUP_KEY &key) const
const_iterator bsl::multiset::lower_bound (const key_type &key) const
template<class LOOKUP_KEY >
bsl::enable_if
< BloombergLP::bslmf::IsTransparentPredicate
< COMPARATOR, LOOKUP_KEY >
::value, const_iterator >
::type 
bsl::multiset::lower_bound (const LOOKUP_KEY &key) const
const_iterator bsl::multiset::upper_bound (const key_type &key) const
template<class LOOKUP_KEY >
bsl::enable_if
< BloombergLP::bslmf::IsTransparentPredicate
< COMPARATOR, LOOKUP_KEY >
::value, const_iterator >
::type 
bsl::multiset::upper_bound (const LOOKUP_KEY &key) const
pair< const_iterator,
const_iterator > 
bsl::multiset::equal_range (const key_type &key) const
template<class LOOKUP_KEY >
bsl::enable_if
< BloombergLP::bslmf::IsTransparentPredicate
< COMPARATOR, LOOKUP_KEY >
::value, pair< const_iterator,
const_iterator > >::type 
bsl::multiset::equal_range (const LOOKUP_KEY &key) const
template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator== (const multiset< KEY, COMPARATOR, ALLOCATOR > &lhs, const multiset< KEY, COMPARATOR, ALLOCATOR > &rhs)
template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator!= (const multiset< KEY, COMPARATOR, ALLOCATOR > &lhs, const multiset< KEY, COMPARATOR, ALLOCATOR > &rhs)
template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator< (const multiset< KEY, COMPARATOR, ALLOCATOR > &lhs, const multiset< KEY, COMPARATOR, ALLOCATOR > &rhs)
template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator> (const multiset< KEY, COMPARATOR, ALLOCATOR > &lhs, const multiset< KEY, COMPARATOR, ALLOCATOR > &rhs)
template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator<= (const multiset< KEY, COMPARATOR, ALLOCATOR > &lhs, const multiset< KEY, COMPARATOR, ALLOCATOR > &rhs)
template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator>= (const multiset< KEY, COMPARATOR, ALLOCATOR > &lhs, const multiset< KEY, COMPARATOR, ALLOCATOR > &rhs)
template<class KEY , class COMPARATOR , class ALLOCATOR , class PREDICATE >
multiset< KEY, COMPARATOR,
ALLOCATOR >::size_type 
bsl::erase_if (multiset< KEY, COMPARATOR, ALLOCATOR > &ms, PREDICATE predicate)
template<class KEY , class COMPARATOR , class ALLOCATOR >
void bsl::swap (multiset< KEY, COMPARATOR, ALLOCATOR > &a, multiset< KEY, COMPARATOR, ALLOCATOR > &b) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(BSLS_KEYWORD_NOEXCEPT_OPERATOR(a.swap(b)))

Variables

void swap(multiset &other)
BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits
void 
bsl::multiset::clear () BSLS_KEYWORD_NOEXCEPT

Detailed Description

Outline
Purpose:
Provide an STL-compliant multiset class.
Classes:
bsl::multiset STL-compatible multiset template
Canonical Header:
bsl_set.h
See also:
Component bslstl_set, Component bslstl_multimap
Description:
This component defines a single class template bsl::multiset, implementing the standard container holding an ordered sequence of possibly duplicate keys.
An instantiation of multiset is an allocator-aware, value-semantic type whose salient attributes are its size (number of keys) and the ordered sequence of keys the multiset contains. If multiset is instantiated with a key type that is not itself value-semantic, then it will not retain all of its value-semantic qualities. In particular, if the key type cannot be tested for equality, then a multiset containing that type cannot be tested for equality. It is even possible to instantiate multiset with a key type that does not have a copy-constructor, in which case the multiset will not be copyable.
A multiset meets the requirements of an associative container with bidirectional iterators in the C++ standard [23.2.4]. The multiset implemented here adheres to the C++11 standard when compiled with a C++11 compiler, and makes the best approximation when compiled with a C++03 compiler. In particular, for C++03 we emulate move semantics, but limit forwarding (in emplace) to const lvalues, and make no effort to emulate noexcept or initializer-lists.
Requirements on KEY:
A multiset is a fully Value-Semantic Type (see bsldoc_glossary) only if the supplied KEY template parameter is fully value-semantic. It is possible to instantiate a multiset with a KEY parameter argument that does not provide a full set of value-semantic operations, but then some methods of the container may not be instantiable. The following terminology, adopted from the C++11 standard, is used in the function documentation of multiset to describe a function's requirements for the KEY template parameter. These terms are also defined in section [17.6.3.1] of the C++11 standard. Note that, in the context of a multiset instantiation, the requirements apply specifically to the multiset's entry type, value_type, which is an alias for KEY.
Legend ------ X - denotes an allocator-aware container type (e.g., multiset) T - value_type associated with X A - type of the allocator used by X m - lvalue of type A (allocator) p, - address (T *) of uninitialized storage for a T within an X rv - rvalue of type (non-'const') T v - rvalue or lvalue of type (possibly const) T args - 0 or more arguments
The following terms are used to more precisely specify the requirements on template parameter types in function-level documentation.
default-insertable: T has a default constructor. More precisely, T is default-insertable into X means that the following expression is well-formed:
Memory Allocation:
The type supplied as a multiset's ALLOCATOR template parameter determines how that multiset will allocate memory. The multiset template supports allocators meeting the requirements of the C++11 standard [17.6.3.5]; in addition, it supports scoped-allocators derived from the bslma::Allocator memory allocation protocol. Clients intending to use bslma-style allocators should use the template's default ALLOCATOR type: The default type for the ALLOCATOR template parameter, bsl::allocator, provides a C++11 standard-compatible adapter for a bslma::Allocator object.
bslma-Style Allocators:
If the (template parameter) type ALLOCATOR of a multiset instantiation is bsl::allocator, then objects of that multiset type will conform to the standard behavior of a bslma-allocator-enabled type. Such a multiset accepts an optional bslma::Allocator argument at construction. If the address of a bslma::Allocator object is explicitly supplied at construction, it is used to supply memory for the multiset throughout its lifetime; otherwise, the multiset will use the default allocator installed at the time of the multiset's construction (see bslma_default). In addition to directly allocating memory from the indicated bslma::Allocator, a multiset supplies that allocator's address to the constructors of contained objects of the (template parameter) type KEY having the bslma::UsesBslmaAllocator trait.
Operations:
This section describes the run-time complexity of operations on instances of multiset:
  Legend
  ------
  'K'             - (template parameter) type 'KEY' of the multiset
  'a', 'b'        - two distinct objects of type 'multiset<K>'
  'rv'            - modifiable rvalue of type 'multiset<K>'
  'n', 'm'        - number of elements in 'a' and 'b' respectively
  'c'             - comparator providing an ordering for objects of type 'K'
  'al'            - STL-style memory allocator
  'i1', 'i2'      - two iterators defining a sequence of 'value_type' objects
  'li'            - object of type 'initializer_list<K>'
  'k'             - object of type 'K'
  'rk'            - modifiable rvalue of type 'K'
  'p1', 'p2'      - two 'const_iterator's belonging to 'a'
  distance(i1,i2) - number of elements in the range '[i1 .. i2)'
  distance(p1,p2) - number of elements in the range '[p1 .. p2)'

  +----------------------------------------------------+--------------------+
  | Operation                                          | Complexity         |
  +====================================================+====================+
  | multiset<K> a;               (default construction)| O[1]               |
  | multiset<K> a(al);                                 |                    |
  | multiset<K> a(c, al);                              |                    |
  +----------------------------------------------------+--------------------+
  | multiset<K> a(b);            (copy construction)   | O[n]               |
  | multiset<K> a(b, al);                              |                    |
  +----------------------------------------------------+--------------------+
  | multiset<K> a(rv);           (move construction)   | O[1] if 'a' and    |
  | multiset<K> a(rv, al);                             | 'rv' use the same  |
  |                                                    | allocator,         |
  |                                                    | O[n] otherwise     |
  +----------------------------------------------------+--------------------+
  | multiset<K> a(i1, i2, al);   (range construction)  | O[N] if [i1, i2)   |
  | multiset<K> a(i1, i2, c, al);                      | is sorted with     |
  |                                                    | 'a.value_comp()',  |
  |                                                    | O[N * log(N)]      |
  |                                                    | otherwise, where N |
  |                                                    | is distance(i1,i2) |
  +----------------------------------------------------+--------------------+
  | multiset<K> a(li);                                 | O[N] if 'li' is    |
  | multiset<K> a(li, al);                             | sorted with        |
  | multiset<K> a(li, c);                              | 'a.value_comp()',  |
  | multiset<K> a(li, c, al);                          | O[N * log(N)]      |
  |                                                    | otherwise, where   |
  |                                                    | N = 'li.size()'    |
  +----------------------------------------------------+--------------------+
  | a.~multiset<K>();            (destruction)         | O[n]               |
  +----------------------------------------------------+--------------------+
  | a = b;                       (copy assignment)     | O[n]               |
  +----------------------------------------------------+--------------------+
  | a = rv;                      (move assignment)     | O[1] if 'a' and    |
  |                                                    | 'rv' use the same  |
  |                                                    | allocator,         |
  |                                                    | O[n] otherwise     |
  +----------------------------------------------------+--------------------+
  | a = li;                                            | O[N] if 'li' is    |
  |                                                    | sorted with        |
  |                                                    | 'a.value_comp()',  |
  |                                                    | O[N * log(N)]      |
  |                                                    | otherwise, where   |
  |                                                    | N = 'li.size()'    |
  +----------------------------------------------------+--------------------+
  | a.begin(), a.end(), a.cbegin(), a.cend(),          | O[1]               |
  | a.rbegin(), a.rend(), a.crbegin(), a.crend()       |                    |
  +----------------------------------------------------+--------------------+
  | a == b, a != b                                     | O[n]               |
  +----------------------------------------------------+--------------------+
  | a < b, a <= b, a > b, a >= b                       | O[n]               |
  +----------------------------------------------------+--------------------+
  | a.swap(b), swap(a, b)                              | O[1] if 'a' and    |
  |                                                    | 'b' use the same   |
  |                                                    | allocator,         |
  |                                                    | O[n + m] otherwise |
  +----------------------------------------------------+--------------------+
  | a.size()                                           | O[1]               |
  +----------------------------------------------------+--------------------+
  | a.max_size()                                       | O[1]               |
  +----------------------------------------------------+--------------------+
  | a.empty()                                          | O[1]               |
  +----------------------------------------------------+--------------------+
  | get_allocator()                                    | O[1]               |
  +----------------------------------------------------+--------------------+
  | a.insert(k)                                        | O[log(n)]          |
  | a.insert(rk)                                       |                    |
  | a.emplace(Args&&...)                               |                    |
  +----------------------------------------------------+--------------------+
  | a.insert(p1, k)                                    | amortized constant |
  | a.insert(p1, rk)                                   | if the value is    |
  | a.emplace_hint(p1, Args&&...)                      | inserted right     |
  |                                                    | before p1,         |
  |                                                    | O[log(n)]          |
  |                                                    | otherwise          |
  +----------------------------------------------------+--------------------+
  | a.insert(i1, i2)                                   | O[N * log(n + N)]  |
  |                                                    | where N is         |
  |                                                    | distance(i1,i2)    |
  +----------------------------------------------------+--------------------+
  | a.insert(li)                                       | O[N * log(n + N)]  |
  |                                                    | where N =          |
  |                                                    |         'li.size()'|
  +----------------------------------------------------+--------------------+
  | a.erase(p1)                                        | amortized constant |
  +----------------------------------------------------+--------------------+
  | a.erase(k)                                         | O[log(n) +         |
  |                                                    | a.count(k)]        |
  +----------------------------------------------------+--------------------+
  | a.erase(p1, p2)                                    | O[log(n) +         |
  |                                                    | distance(p1, p2)]  |
  +----------------------------------------------------+--------------------+
  | a.clear()                                          | O[n]               |
  +----------------------------------------------------+--------------------+
  | a.key_comp()                                       | O[1]               |
  +----------------------------------------------------+--------------------+
  | a.value_comp()                                     | O[1]               |
  +----------------------------------------------------+--------------------+
  | a.find(k)                                          | O[log(n)]          |
  +----------------------------------------------------+--------------------+
  | a.count(k)                                         | O[log(n) +         |
  |                                                    | a.count(k)]        |
  +----------------------------------------------------+--------------------+
  | a.lower_bound(k)                                   | O[log(n)]          |
  +----------------------------------------------------+--------------------+
  | a.upper_bound(k)                                   | O[log(n)]          |
  +----------------------------------------------------+--------------------+
  | a.equal_range(k)                                   | O[log(n)]          |
  +----------------------------------------------------+--------------------+
Usage:
In this section we show intended use of this component.
Example 1: Creating a Shopping Cart:
In this example, we will utilize bsl::multiset to define a class ShoppingCart, that characterizes a simple online shopping cart with the ability to add, remove, and view items in the shopping cart.
Note that this example uses a type string that is based on the standard type string (see bslstl_string). For the sake of brevity, the implementation of string is not explored here.
First, we define a comparison functor for string objects:
  struct StringComparator {
      // This 'struct' defines an ordering on 'string' values, allowing
      // them to be included in sorted containers such as 'bsl::multiset'.

      bool operator()(const string& lhs, const string& rhs) const
          // Return 'true' if the value of the specified 'lhs' is less than
          // (ordered before) the value of the specified 'rhs', and 'false'
          // otherwise.
      {
          int cmp = std::strcmp(lhs.c_str(), rhs.c_str());
          return cmp < 0;
      }
  };
Then, we define the public interface for ShoppingCart:
  class ShoppingCart {
      // This class provides an ordered collection of (possibly duplicate)
      // items in a shopping cart.  For simplicity of the usage example, each
      // item in the shopping cart is represented by a 'string'.
Here, we create a type alias, StringSet, for a bsl::multiset that will serve as the data member for a ShoppingCart. A StringSet has keys of type string, and uses the default ALLOCATOR template parameter to be compatible with bslma style allocators:
      // PRIVATE TYPES
      typedef bsl::multiset<string, StringComparator> StringSet;
          // This 'typedef' is an alias for a multiset of 'string' objects,
          // each representing an item in a shopping cart;

      // DATA
      StringSet d_items;  // multiset of items in the shopping cart

      // FRIENDS
      friend bool operator==(const ShoppingCart& lhs,
                             const ShoppingCart& rhs);

    public:
      // PUBLIC TYPES
      typedef StringSet::const_iterator ConstIterator;
          // This 'typedef' provides an alias for the type of an iterator
          // providing non-modifiable access to the items in a
          // 'ShoppingCart'.

      // CREATORS
      ShoppingCart(bslma::Allocator *basicAllocator = 0);
          // Create an empty 'Shopping' object.  Optionally specify a
          // 'basicAllocator' used to supply memory.  If 'basicAllocator' is
          // 0, the currently installed default allocator is used.

      ShoppingCart(const ShoppingCart&  original,
                   bslma::Allocator    *basicAllocator = 0);
          // Create a 'ShoppingCart' object having the same value as the
          // specified 'original' object.  Optionally specify a
          // 'basicAllocator' used to supply memory.  If 'basicAllocator' is
          // 0, the currently installed default allocator is used.

          // Destroy this object.

      // MANIPULATORS
      ShoppingCart& operator=(const ShoppingCart& rhs);
          // Assign to this object the value of the specified 'rhs' object,
          // and return a reference providing modifiable access to this
          // object.

      void addItem(const string& name);
          // Add an item with the specified 'name' to this shopping cart.
          // The behavior is undefined unless 'name' is a non-empty strings.

      size_t removeItems(const string& name);
          // Remove from this shopping cart all items having the specified
          // 'name', if they exist, and return the number of removed items;
          // otherwise, return 0 with no other effects.  The behavior is
          // undefined unless 'name' is a non-empty strings.

      // ACCESSORS
      size_t count(const string& name) const;
          // Return the number of items in the shopping cart with the
          // specified 'name'.  The behavior is undefined unless 'name' is a
          // non-empty strings.

      ConstIterator begin() const;
          // Return an iterator providing non-modifiable access to the first
          // item in the ordered sequence of item held in this shopping cart,
          // or the past-the-end iterator if this shopping cart is empty.

      ConstIterator end() const;
          // Return an iterator providing non-modifiable access to the
          // past-the-end item in the ordered sequence of items maintained by
          // this shopping cart.

      size_t numItems() const;
          // Return the number of items contained in this shopping cart.
  };
Then, we declare the free operators for ShoppingCart:
  inline
  bool operator==(const ShoppingCart& lhs, const ShoppingCart& rhs);
      // Return 'true' if the specified 'lhs' and 'rhs' objects have the same
      // value, and 'false' otherwise.  Two 'ShoppingCart' objects have the
      // same value if they have the same number of items, and each
      // corresponding item, in their respective ordered sequence of items,
      // is the same.

  inline
  bool operator!=(const ShoppingCart& lhs, const ShoppingCart& rhs);
      // Return 'true' if the specified 'lhs' and 'rhs' objects do not have
      // the same value, and 'false' otherwise.  Two 'ShoppingCart' objects
      // do not have the same value if they either differ in their number of
      // contained items, or if any of the corresponding items, in their
      // respective ordered sequences of items, is not the same.
Now, we define the implementations methods of the ShoppingCart class:
  // CREATORS
  inline
  ShoppingCart::ShoppingCart(bslma::Allocator *basicAllocator)
  : d_items(basicAllocator)
  {
  }
Notice that, on construction, we pass the contained bsl::multiset object the allocator supplied to ShoppingCart at construction'.
  inline
  ShoppingCart::ShoppingCart(const ShoppingCart&   original,
                             bslma::Allocator     *basicAllocator)
  : d_items(original.d_items, basicAllocator)
  {
  }

  // MANIPULATORS
  inline
  ShoppingCart& ShoppingCart::operator=(const ShoppingCart& rhs)
  {
      d_items = rhs.d_items;
      return *this;
  }

  inline
  void ShoppingCart::addItem(const string& name)
  {
      BSLS_ASSERT(!name.empty());

      d_items.insert(name);
  }

  inline
  size_t ShoppingCart::removeItems(const string& name)
  {
      BSLS_ASSERT(!name.empty());

      return d_items.erase(name);
  }

  // ACCESSORS
  size_t ShoppingCart::count(const string& name) const
  {
      BSLS_ASSERT(!name.empty());

      return d_items.count(name);
  }

  ShoppingCart::ConstIterator ShoppingCart::begin() const
  {
      return d_items.begin();
  }

  ShoppingCart::ConstIterator ShoppingCart::end() const
  {
      return d_items.end();
  }

  size_t ShoppingCart::numItems() const
  {
      return d_items.size();
  }
Finally, we implement the free operators for ShoppingCart:
  inline
  bool operator==(const ShoppingCart& lhs, const ShoppingCart& rhs)
  {
      return lhs.d_items == rhs.d_items;
  }

  inline
  bool operator!=(const ShoppingCart& lhs, const ShoppingCart& rhs)
  {
      return !(lhs == rhs);
  }

Typedef Documentation

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef KEY bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::key_type [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef KEY bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::value_type [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef COMPARATOR bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::key_compare [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef COMPARATOR bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::value_compare [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef ALLOCATOR bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::allocator_type [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef value_type& bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::reference [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef const value_type& bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::const_reference [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef AllocatorTraits::size_type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::size_type [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef AllocatorTraits::difference_type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::difference_type [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef AllocatorTraits::pointer bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::pointer [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef AllocatorTraits::const_pointer bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::const_pointer [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef BloombergLP::bslstl::TreeIterator<const value_type, Node, difference_type> bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::iterator [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef BloombergLP::bslstl::TreeIterator<const value_type, Node, difference_type> bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::const_iterator [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef bsl::reverse_iterator<iterator> bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::reverse_iterator [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
typedef bsl::reverse_iterator<const_iterator> bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::const_reverse_iterator [inherited]

Function Documentation

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::DataWrapper::DataWrapper ( const COMPARATOR &  comparator,
const ALLOCATOR &  basicAllocator 
) [explicit, inherited]

Create a data wrapper using a copy of the specified comparator to order keys and a copy of the specified basicAllocator to supply memory.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::DataWrapper::DataWrapper ( BloombergLP::bslmf::MovableRef< DataWrapper >  original  )  [inherited]

Create a data wrapper initialized to the contents of the pool associated with the specified original data wrapper. The comparator and allocator associated with original are propagated to the new data wrapper. original is left in a valid but unspecified state.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
NodeFactory& bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::DataWrapper::nodeFactory (  )  [inherited]

Return a reference providing modifiable access to the node factory associated with this data wrapper.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const NodeFactory& bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::DataWrapper::nodeFactory (  )  const [inherited]

Return a reference providing non-modifiable access to the node factory associated with this data wrapper.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset (  )  [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( const COMPARATOR &  comparator,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
) [inline, explicit, inherited]
Parameters:
basicAllocator Create an empty multiset. Optionally specify a comparator used to order keys contained in this object. If comparator is not supplied, a default-constructed object of the (template parameter) type COMPARATOR is used. Optionally specify the basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used.
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( const ALLOCATOR &  basicAllocator  )  [explicit, inherited]

Create an empty multiset that uses the specified basicAllocator to supply memory. Use a default-constructed object of the (template parameter) type COMPARATOR to order the keys contained in this multiset. Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( const multiset< KEY, COMPARATOR, ALLOCATOR > &  original  )  [inherited]

Create a multiset having the same value as the specified original object. Use a copy of original.key_comp() to order the keys contained in this multiset. Use the allocator returned by 'bslallocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.get_allocator())' to allocate memory. This method requires that the (template parameter) type KEY be copy-insertable into this multiset (see Requirements on KEY).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( BloombergLP::bslmf::MovableRef< multiset< KEY, COMPARATOR, ALLOCATOR > >  original  )  [inherited]

IMPLICIT: Create a multiset having the same value as that of the specified original object by moving (in constant time) the contents of original to the new multiset. Use a copy of original.key_comp() to order the keys contained in this multiset. The allocator associated with original is propagated for use in the newly-created multiset. original is left in a valid but unspecified state.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( const multiset< KEY, COMPARATOR, ALLOCATOR > &  original,
const typename type_identity< ALLOCATOR >::type basicAllocator 
) [inherited]

Create a multiset having the same value as the specified original object that uses the specified basicAllocator to supply memory. Use a copy of original.key_comp() to order the keys contained in this multiset. This method requires that the (template parameter) type KEY be copy-insertable into this multiset (see Requirements on KEY). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) type ALLOCATOR is bsl::allocator (the default).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( BloombergLP::bslmf::MovableRef< multiset< KEY, COMPARATOR, ALLOCATOR > >  original,
const typename type_identity< ALLOCATOR >::type basicAllocator 
) [inherited]

Create a multiset having the same value as the specified original object that uses the specified basicAllocator to supply memory. The contents of original are moved (in constant time) to the new multiset if basicAllocator == original.get_allocator(), and are move-inserted (in linear time) using basicAllocator otherwise. original is left in a valid but unspecified state. Use a copy of original.key_comp() to order the keys contained in this multiset. This method requires that the (template parameter) type KEY be move-insertable into this multiset (see Requirements on KEY). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) type ALLOCATOR is bsl::allocator (the default).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class INPUT_ITERATOR >
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
const COMPARATOR &  comparator = COMPARATOR(),
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
) [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class INPUT_ITERATOR >
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
const ALLOCATOR &  basicAllocator 
) [inherited]

Create a multiset, and insert each value_type object in the sequence starting at the specified first element, and ending immediately before the specified last element. Optionally specify a comparator used to order keys contained in this object. If comparator is not supplied, a default-constructed object of the (template parameter) type COMPARATOR is used. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. If the sequence first to last is ordered according to comparator, then this operation has O[N] complexity, where N is the number of elements between first and last, otherwise this operation has O[N * log(N)] complexity. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3] providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this multiset, where i is a dereferenceable iterator in the range [first .. last) (see Requirements on KEY). The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last. Note that a bslma::Allocator * can be supplied for basicAllocator if the type ALLOCATOR is bsl::allocator (the default).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( std::initializer_list< KEY >  values,
const COMPARATOR &  comparator = COMPARATOR(),
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
) [inherited]
template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::multiset ( std::initializer_list< KEY >  values,
const ALLOCATOR &  basicAllocator 
) [inherited]

Create a multiset and insert each value_type object in the specified values initializer list. Optionally specify a comparator used to order keys contained in this object. If comparator is not supplied, a default-constructed object of the (template parameter) type COMPARATOR is used. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. If values is ordered according to comparator, then this operation has O[N] complexity, where N is the number of elements in values; otherwise this operation has O[N * log(N)] complexity. This method requires that the (template parameter) type KEY be copy-insertable into this multiset (see Requirements on KEY). Note that a bslma::Allocator * can be supplied for basicAllocator if the type ALLOCATOR is bsl::allocator (the default).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::~multiset (  )  [inherited]

Destroy this object.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
multiset& bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::operator= ( const multiset< KEY, COMPARATOR, ALLOCATOR > &  rhs  )  [inherited]

Assign to this object the value and comparator of the specified rhs object, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_copy_assignment, and return a reference providing modifiable access to this object. If an exception is thrown, *this is left in a valid but unspecified state. This method requires that the (template parameter) type KEY be copy-assignable and copy-insertable into this multiset (see Requirements on KEY).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
multiset& operator= (BloombergLP::bslmf::MovableRef<multiset> rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION( AllocatorTraits multiset& bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::operator= ( std::initializer_list< KEY >  values  )  [inherited]

< Assign to this object the value and comparator of the specified rhs object, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_move_assignment, and return a reference providing modifiable access to this object. The contents of rhs are moved (in constant time) to this multiset if get_allocator() == rhs.get_allocator() (after accounting for the aforementioned trait); otherwise, all elements in this multiset are either destroyed or move-assigned to and each additional element in rhs is move-inserted into this multiset. rhs is left in a valid but unspecified state, and if an exception is thrown, *this is left in a valid but unspecified state. This method requires that the (template parameter) type KEY be move-assignable and move-insertable into this multiset (see Requirements on KEY). Assign to this object the value resulting from first clearing this multiset and then inserting each value_type object in the specified values initializer list and return a reference providing modifiable access to this object. This method requires that the (template parameter) type KEY be copy-insertable into this multiset (see Requirements on KEY).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::begin (  )  [inherited]

Return an iterator providing modifiable access to the first value_type object in the ordered sequence of value_type objects maintained by this multiset, or the end iterator if this multiset is empty.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::end (  )  [inherited]

Return an iterator providing modifiable access to the past-the-end element in the ordered sequence of value_type objects maintained by this multiset.

Referenced by bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::count(), and bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::equal_range().

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
reverse_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::rbegin (  )  [inherited]

Return a reverse iterator providing modifiable access to the last value_type object in the ordered sequence of value_type objects maintained by this multiset, or rend if this multiset is empty.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
reverse_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::rend (  )  [inherited]

Return a reverse iterator providing modifiable access to the prior-to-the-beginning element in the ordered sequence of value_type objects maintained by this multiset.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::insert ( const value_type value  )  [inherited]

Insert the specified value into this multiset. If a range containing elements equivalent to value already exists, insert the value at the end of that range. Return an iterator referring to the newly inserted value_type object. This method requires that the (template parameter) type KEY be copy-insertable into this multiset (see Requirements on KEY).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::insert ( BloombergLP::bslmf::MovableRef< value_type value  )  [inherited]

Insert the specified value into this multiset. If a range containing elements equivalent to value already exists in this multiset, insert value at the end of that range. value is left in a valid but unspecified state. Return an iterator referring to the newly inserted value_type object in this multiset that is equivalent to value. This method requires that the (template parameter) type KEY be move-insertable into this multiset (see Requirements on KEY).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::insert ( const_iterator  hint,
const value_type value 
) [inherited]

Insert the specified value into this multiset (in amortized constant time if the specified hint is a valid immediate successor to value). Return an iterator referring to the newly inserted value_type object in this multiset that is equivalent to value. If hint is not a valid immediate successor to value, this operation has O[log(N)] complexity, where N is the size of this multiset. This method requires that the (template parameter) type KEY be copy-insertable into this multiset (see Requirements on KEY). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::insert ( const_iterator  hint,
BloombergLP::bslmf::MovableRef< value_type value 
) [inherited]

Insert the specified value into this multiset (in amortized constant time if the specified hint is a valid immediate successor to value). value is left in a valid but unspecified state. Return an iterator referring to the newly inserted value_type object in this multiset that is equivalent to value. If hint is not a valid immediate successor to value, this operation has O[log(N)] complexity, where N is the size of this multiset. This method requires that the (template parameter) type KEY be move-insertable into this multiset (see Requirements on KEY). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class INPUT_ITERATOR >
void bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::insert ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last 
) [inherited]

Insert into this multiset the value of each value_type object in the range starting at the specified first iterator and ending immediately before the specified last iterator. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3] providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this multiset, where i is a dereferenceable iterator in the range [first .. last) (see Requirements on KEY). The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
void bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::insert ( std::initializer_list< KEY >  values  )  [inherited]

Insert into this multiset the value of each value_type object in the specified values initializer list. This method requires that the (template parameter) type KEY be copy-insertable into this multiset (see Requirements on KEY).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class... Args>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::emplace ( Args &&...  args  )  [inherited]

Insert into this multiset a newly-created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) args to the corresponding constructor of value_type. Return an iterator referring to the newly created and inserted object in this multiset. This method requires that the (template parameter) type KEY be emplace-constructible from args (see Requirements on KEY).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class... Args>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::emplace_hint ( const_iterator  hint,
Args &&...  args 
) [inherited]

Insert into this multiset a newly-created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) args to the corresponding constructor of value_type (in amortized constant time if the specified hint is a valid immediate successor to the value_type object constructed from args). Return an iterator referring to the newly created and inserted object in this multiset. If hint is not a valid immediate successor to the value_type object implied by args, this operation has O[log(N)] complexity where N is the size of this multiset. This method requires that the (template parameter) type KEY be emplace-constructible from args (see Requirements on KEY). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::erase ( const_iterator  position  )  [inherited]

Remove from this multiset the value_type object at the specified position, and return an iterator referring to the element immediately following the removed element, or to the past-the-end position if the removed element was the last element in the sequence of elements maintained by this multiset. This method invalidates only iterators and references to the removed element and previously saved values of the end() iterator. The behavior is undefined unless position refers to a value_type object in this multiset.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
size_type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::erase ( const key_type key  )  [inherited]

Remove from this multiset all value_type objects equivalent to the specified key, if they exist, and return the number of erased objects; otherwise, if there are no value_type objects equivalent to key, return 0 with no other effect. This method invalidates only iterators and references to the removed element and previously saved values of the end() iterator.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::erase ( const_iterator  first,
const_iterator  last 
) [inherited]

Remove from this multiset the value_type objects starting at the specified first position up to, but not including the specified last position, and return last. This method invalidates only iterators and references to the removed element and previously saved values of the end() iterator. The behavior is undefined unless first and last either refer to elements in this multiset or are the end iterator, and the first position is at or before the last position in the ordered sequence provided by this container.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::find ( const key_type key  )  [inline, inherited]
Parameters:
key Return an iterator providing modifiable access to the first value_type object in this multiset equivalent to the specified key, if such an object exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, iterator>::type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::find ( const LOOKUP_KEY &  key  )  [inline, inherited]
Parameters:
key Return an iterator providing modifiable access to the first value_type object in this multiset equivalent to the specified key, if such an object exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound ( const key_type key  )  [inline, inherited]
Parameters:
key Return an iterator providing modifiable access to the first (i.e., ordered least) value_type object in this multiset greater-than or equal-to the specified key, and the past-the-end iterator if this multiset does not contain a value_type object greater-than or equal-to key. Note that this function returns the first position before which a value_type object equivalent to key could be inserted into the ordered sequence maintained by this multiset, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

Referenced by bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::count(), and bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::equal_range().

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, iterator>::type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound ( const LOOKUP_KEY &  key  )  [inline, inherited]
Parameters:
key Return an iterator providing modifiable access to the first (i.e., ordered least) value_type object in this multiset greater-than or equal-to the specified key, and the past-the-end iterator if this multiset does not contain a value_type object greater-than or equal-to key. Note that this function returns the first position before which a value_type object equivalent to key could be inserted into the ordered sequence maintained by this multiset, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::upper_bound ( const key_type key  )  [inline, inherited]
Parameters:
key Return an iterator providing modifiable access to the first (i.e., ordered least) value_type object in this multiset greater than the specified key, and the past-the-end iterator if this multiset does not contain a value_type object greater-than key. Note that this function returns the last position before which a value_type object equivalent to key could be inserted into the ordered sequence maintained by this multiset, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

Referenced by bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::equal_range().

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, iterator>::type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::upper_bound ( const LOOKUP_KEY &  key  )  [inline, inherited]
Parameters:
key Return an iterator providing modifiable access to the first (i.e., ordered least) value_type object in this multiset greater than the specified key, and the past-the-end iterator if this multiset does not contain a value_type object greater-than key. Note that this function returns the last position before which a value_type object equivalent to key could be inserted into the ordered sequence maintained by this multiset, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
pair<iterator, iterator> bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::equal_range ( const key_type key  )  [inline, inherited]
Parameters:
key Return a pair of iterators providing modifiable access to the sequence of value_type objects in this multiset equivalent to the specified key, where the first iterator is positioned at the start of the sequence and the second is positioned one past the end of the sequence. The first returned iterator will be lower_bound(key), the second returned iterator will be upper_bound(key), and, if this multiset contains no value_type objects with an equivalent key, then the two returned iterators will have the same value.

Note: implemented inline due to Sun CC compilation error.

References bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::end(), bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound(), and bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::upper_bound().

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, pair<iterator, iterator> >::type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::equal_range ( const LOOKUP_KEY &  key  )  [inline, inherited]
Parameters:
key Return a pair of iterators providing modifiable access to the sequence of value_type objects in this multiset equivalent to the specified key, where the first iterator is positioned at the start of the sequence and the second is positioned one past the end of the sequence. The first returned iterator will be lower_bound(key), the second returned iterator will be upper_bound(key), and, if this multiset contains no value_type objects with an equivalent key, then the two returned iterators will have the same value.

Note: implemented inline due to Sun CC compilation error.

References bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::end(), bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound(), and bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::upper_bound().

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
allocator_type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::get_allocator (  )  const [inherited]

Return (a copy of) the allocator used for memory allocation by this multiset.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::begin (  )  const [inherited]

Return an iterator providing non-modifiable access to the first value_type object in the ordered sequence of value_type objects maintained by this multiset, or the end iterator if this multiset is empty.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::end (  )  const [inherited]

Return an iterator providing non-modifiable access to the past-the-end element in the ordered sequence of value_type objects maintained by this multiset.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_reverse_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::rbegin (  )  const [inherited]

Return a reverse iterator providing non-modifiable access to the last value_type object in the ordered sequence of value_type objects maintained by this multiset, or rend if this multiset is empty.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_reverse_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::rend (  )  const [inherited]

Return a reverse iterator providing non-modifiable access to the prior-to-the-beginning element in the ordered sequence of value_type objects maintained by this multiset.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::cbegin (  )  const [inherited]

Return an iterator providing non-modifiable access to the first value_type object in the ordered sequence of value_type objects maintained by this multiset, or the end iterator if this multiset is empty.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::cend (  )  const [inherited]

Return an iterator providing non-modifiable access to the past-the-end element in the ordered sequence of value_type objects maintained by this multiset.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_reverse_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::crbegin (  )  const [inherited]

Return a reverse iterator providing non-modifiable access to the last value_type object in the ordered sequence of value_type objects maintained by this multiset, or rend if this multiset is empty.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_reverse_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::crend (  )  const [inherited]

Return a reverse iterator providing non-modifiable access to the prior-to-the-beginning element in the ordered sequence of value_type objects maintained by this multiset.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
bool bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::empty (  )  const [inherited]

Return true if this multiset contains no elements, and false otherwise.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
size_type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::size (  )  const [inherited]

Return the number of elements in this multiset.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
size_type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::max_size (  )  const [inherited]

Return a theoretical upper bound on the largest number of elements that this multiset could possibly hold. Note that there is no guarantee that the multiset can successfully grow to the returned size, or even close to that size without running out of resources.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
key_compare bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::key_comp (  )  const [inherited]

Return the key-comparison functor (or function pointer) used by this multiset; if a comparator was supplied at construction, return its value, otherwise return a default constructed key_compare object. Note that this comparator compares objects of type KEY, which is the type of the value_type objects contained in this multiset.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
value_compare bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::value_comp (  )  const [inherited]

Return a functor for comparing two value_type objects using key_comp(). Note that since value_type is an alias to KEY for multiset, this method returns the same functor as key_comp().

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::find ( const key_type key  )  const [inline, inherited]

< Return an iterator providing non-modifiable access to the first value_type object that is equivalent to the specified key in ordered sequence maintained by this multiset, if such an object exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, const_iterator>::type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::find ( const LOOKUP_KEY &  key  )  const [inline, inherited]

< Return an iterator providing non-modifiable access to the first value_type object that is equivalent to the specified key in ordered sequence maintained by this multiset, if such an object exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
size_type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::count ( const key_type key  )  const [inline, inherited]

< Return the number of value_type objects within this multiset that are equivalent to the specified key.

Note: implemented inline due to Sun CC compilation error.

References bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::end(), and bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound().

Referenced by bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::count().

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, size_type>::type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::count ( const LOOKUP_KEY &  key  )  const [inline, inherited]

< Return the number of value_type objects within this multiset that are equivalent to the specified key.

Note: implemented inline due to Sun CC compilation error.

References bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::count(), bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::end(), and bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound().

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound ( const key_type key  )  const [inline, inherited]

< Return an iterator providing non-modifiable access to the first (i.e., ordered least) value_type object in this multiset greater-than or equal-to the specified key, and the past-the-end iterator if this multiset does not contain a value_type greater-than or equal-to key. Note that this function returns the first position before which a value_type object equivalent to key could be inserted into the ordered sequence maintained by this multiset, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, const_iterator>::type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound ( const LOOKUP_KEY &  key  )  const [inline, inherited]

< Return an iterator providing non-modifiable access to the first (i.e., ordered least) value_type object in this multiset greater-than or equal-to the specified key, and the past-the-end iterator if this multiset does not contain a value_type greater-than or equal-to key. Note that this function returns the first position before which a value_type object equivalent to key could be inserted into the ordered sequence maintained by this multiset, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
const_iterator bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::upper_bound ( const key_type key  )  const [inline, inherited]

< Return an iterator providing non-modifiable access to the first (i.e., ordered least) value_type object in this multiset greater than the specified key, and the past-the-end iterator if this multiset does not contain a value_type object greater-than key. Note that this function returns the last position before which a value_type object equivalent to key could be inserted into the ordered sequence maintained by this multiset, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, const_iterator>::type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::upper_bound ( const LOOKUP_KEY &  key  )  const [inline, inherited]

< Return an iterator providing non-modifiable access to the first (i.e., ordered least) value_type object in this multiset greater than the specified key, and the past-the-end iterator if this multiset does not contain a value_type object greater-than key. Note that this function returns the last position before which a value_type object equivalent to key could be inserted into the ordered sequence maintained by this multiset, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
pair<const_iterator, const_iterator> bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::equal_range ( const key_type key  )  const [inline, inherited]

< Return a pair of iterators providing non-modifiable access to the sequence of value_type objects in this multiset that are equivalent to the specified key, where the first iterator is positioned at the start of the sequence, and the second is positioned one past the end of the sequence. The first returned iterator will be lower_bound(key); the second returned iterator will be upper_bound(key); and, if this multiset contains no value_type objects equivalent to key, then the two returned iterators will have the same value.

Note: implemented inline due to Sun CC compilation error.

References bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::end(), bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound(), and bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::upper_bound().

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, pair<const_iterator, const_iterator> >::type bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::equal_range ( const LOOKUP_KEY &  key  )  const [inline, inherited]

< Return a pair of iterators providing non-modifiable access to the sequence of value_type objects in this multiset that are equivalent to the specified key, where the first iterator is positioned at the start of the sequence, and the second is positioned one past the end of the sequence. The first returned iterator will be lower_bound(key); the second returned iterator will be upper_bound(key); and, if this multiset contains no value_type objects equivalent to key, then the two returned iterators will have the same value.

Note: implemented inline due to Sun CC compilation error.

References bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::end(), bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::lower_bound(), and bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::upper_bound().

template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator== ( const multiset< KEY, COMPARATOR, ALLOCATOR > &  lhs,
const multiset< KEY, COMPARATOR, ALLOCATOR > &  rhs 
)

Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two multiset objects lhs and rhs have the same value if they have the same number of keys, and each element in the ordered sequence of keys of lhs has the same value as the corresponding element in the ordered sequence of keys of rhs. This method requires that the (template parameter) type KEY be equality-comparable (see Requirements on KEY).

template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator!= ( const multiset< KEY, COMPARATOR, ALLOCATOR > &  lhs,
const multiset< KEY, COMPARATOR, ALLOCATOR > &  rhs 
)

Return true if the specified lhs and rhs objects do not have the same value, and false otherwise. Two multiset objects lhs and rhs do not have the same value if they do not have the same number of keys, or some element in the ordered sequence of keys of lhs does not have the same value as the corresponding element in the ordered sequence of keys of rhs. This method requires that the (template parameter) type KEY be equality-comparable (see Requirements on KEY).

template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator< ( const multiset< KEY, COMPARATOR, ALLOCATOR > &  lhs,
const multiset< KEY, COMPARATOR, ALLOCATOR > &  rhs 
)

Return true if the value of the specified lhs multiset is lexicographically less than that of the specified rhs multiset, and false otherwise. Given iterators i and j over the respective sequences [lhs.begin() .. lhs.end()) and [rhs.begin() .. rhs.end()), the value of multiset lhs is lexicographically less than that of multiset rhs if true == *i < *j for the first pair of corresponding iterator positions where *i < *j and *j < *i are not both false. If no such corresponding iterator position exists, the value of lhs is lexicographically less than that of rhs if lhs.size() < rhs.size(). This method requires that operator<, inducing a total order, be defined for value_type.

template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator> ( const multiset< KEY, COMPARATOR, ALLOCATOR > &  lhs,
const multiset< KEY, COMPARATOR, ALLOCATOR > &  rhs 
)

Return true if the value of the specified lhs multiset is lexicographically greater than that of the specified rhs multiset, and false otherwise. The value of multiset lhs is lexicographically greater than that of multiset rhs if rhs is lexicographically less than lhs (see operator<). This method requires that operator<, inducing a total order, be defined for value_type. Note that this operator returns rhs < lhs.

template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator<= ( const multiset< KEY, COMPARATOR, ALLOCATOR > &  lhs,
const multiset< KEY, COMPARATOR, ALLOCATOR > &  rhs 
)

Return true if the value of the specified lhs multiset is lexicographically less than or equal to that of the specified rhs multiset, and false otherwise. The value of multiset lhs is lexicographically less than or equal to that of multiset rhs if rhs is not lexicographically less than lhs (see operator<). This method requires that operator<, inducing a total order, be defined for value_type. Note that this operator returns !(rhs < lhs).

template<class KEY , class COMPARATOR , class ALLOCATOR >
bool bsl::operator>= ( const multiset< KEY, COMPARATOR, ALLOCATOR > &  lhs,
const multiset< KEY, COMPARATOR, ALLOCATOR > &  rhs 
)

Return true if the value of the specified lhs multiset is lexicographically greater than or equal to that of the specified rhs multiset, and false otherwise. The value of multiset lhs is lexicographically greater than or equal to that of multiset rhs if lhs is not lexicographically less than rhs (see operator<). This method requires that operator<, inducing a total order, be defined for value_type. Note that this operator returns !(lhs < rhs).

template<class KEY , class COMPARATOR , class ALLOCATOR , class PREDICATE >
multiset<KEY, COMPARATOR, ALLOCATOR>::size_type bsl::erase_if ( multiset< KEY, COMPARATOR, ALLOCATOR > &  ms,
PREDICATE  predicate 
)

Erase all the elements in the specified multiset ms that satisfy the specified predicate predicate. Return the number of elements erased.

template<class KEY , class COMPARATOR , class ALLOCATOR >
void bsl::swap ( multiset< KEY, COMPARATOR, ALLOCATOR > &  a,
multiset< KEY, COMPARATOR, ALLOCATOR > &  b 
)

Exchange the value and comparator of the specified a object with those of the specified b object; also exchange the allocator of a with that of b if the (template parameter) type ALLOCATOR has the propagate_on_container_swap trait, and do not modify either allocator otherwise. This function provides the no-throw exception-safety guarantee if and only if the (template parameter) type COMPARATOR provides a no-throw swap operation, and provides the basic exception-safety guarantee otherwise; if an exception is thrown, both objects are left in valid but unspecified states. This operation has O[1] complexity if either a was created with the same allocator as b or ALLOCATOR has the propagate_on_container_swap trait; otherwise, it has O[n + m] complexity, where n and m are the number of elements in a and b, respectively. Note that this function's support for swapping objects created with different allocators when ALLOCATOR does not have the propagate_on_container_swap trait is a departure from the C++ Standard.


Variable Documentation

template<class KEY , class COMPARATOR = std::less<KEY>, class ALLOCATOR = bsl::allocator<KEY>>
void swap (multiset& other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION( AllocatorTraits void bsl::multiset< KEY, COMPARATOR, ALLOCATOR >::clear() BSLS_KEYWORD_NOEXCEPT [inherited]

< Exchange the value and comparator of this object with those of the specified other object; also exchange the allocator of this object with that of other if the (template parameter) type ALLOCATOR has the propagate_on_container_swap trait, and do not modify either allocator otherwise. This method provides the no-throw exception-safety guarantee if and only if the (template parameter) type COMPARATOR provides a no-throw swap operation, and provides the basic exception-safety guarantee otherwise; if an exception is thrown, both objects are left in valid but unspecified states. This operation has O[1] complexity if either this object was created with the same allocator as other or ALLOCATOR has the propagate_on_container_swap trait; otherwise, it has O[n + m] complexity, where n and m are the number of elements in this object and other, respectively. Note that this method's support for swapping objects created with different allocators when ALLOCATOR does not have the propagate_on_container_swap trait is a departure from the C++ Standard. Remove all entries from this multiset. Note that the multiset is empty after this call, but allocated memory may be retained for future use.