Quick Links:

bal | bbl | bdl | bsl

Classes | Typedefs | Functions | Variables

Component bslstl_multimap
[Package bslstl]

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

Classes

class  bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >
class  bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::DataWrapper
class  bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::value_compare

Typedefs

typedef KEY bsl::multimap::key_type
typedef VALUE bsl::multimap::mapped_type
typedef pair< const KEY, VALUE > bsl::multimap::value_type
typedef COMPARATOR bsl::multimap::key_compare
typedef ALLOCATOR bsl::multimap::allocator_type
typedef value_type & bsl::multimap::reference
typedef const value_type & bsl::multimap::const_reference
typedef AllocatorTraits::size_type bsl::multimap::size_type
typedef
AllocatorTraits::difference_type 
bsl::multimap::difference_type
typedef AllocatorTraits::pointer bsl::multimap::pointer
typedef
AllocatorTraits::const_pointer 
bsl::multimap::const_pointer
typedef
BloombergLP::bslstl::TreeIterator
< value_type, Node,
difference_type > 
bsl::multimap::iterator
typedef
BloombergLP::bslstl::TreeIterator
< const value_type, Node,
difference_type > 
bsl::multimap::const_iterator
typedef bsl::reverse_iterator
< iterator > 
bsl::multimap::reverse_iterator
typedef bsl::reverse_iterator
< const_iterator > 
bsl::multimap::const_reverse_iterator
typedef bool bsl::multimap::value_compare::result_type
typedef value_type bsl::multimap::value_compare::first_argument_type
typedef value_type bsl::multimap::value_compare::second_argument_type

Functions

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

Variables

COMPARATOR bsl::multimap::value_compare::comp
void swap(multimap &other)
BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits
void 
bsl::multimap::clear () BSLS_KEYWORD_NOEXCEPT

Detailed Description

Outline
Purpose:
Provide an STL-compliant multimap class.
Classes:
bsl::multimap STL-compatible multimap template
Canonical Header:
bsl_map.h
See also:
Component bslstl_map, Component bslstl_multiset
Description:
This component defines a single class template, bsl::multimap, implementing the standard container holding an ordered sequence of key-value pairs (possibly having duplicate keys), and presenting a mapping from the keys (of a template parameter type, KEY) to their associated values (of another template parameter type, VALUE).
An instantiation of multimap is an allocator-aware, value-semantic type whose salient attributes are its size (number of key-value pairs) and the ordered sequence of key-value pairs the multimap contains. If multimap is instantiated with either a key type or mapped-value type that is not itself value-semantic, then it will not retain all of its value-semantic qualities. In particular, if either the key or value type cannot be tested for equality, then a multimap containing that type cannot be tested for equality. It is even possible to instantiate multimap with a key or mapped-value type that does not have a copy-constructor, in which case the multimap will not be copyable.
A multimap meets the requirements of an associative container with bidirectional iterators in the C++ standard [23.2.4]. The multimap 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 and VALUE:
A multimap is a fully Value-Semantic Type (see bsldoc_glossary) only if the supplied KEY and VALUE template parameters are themselves fully value-semantic. It is possible to instantiate a multimap with KEY and VALUE parameter arguments that do 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 multimap to describe a function's requirements for the KEY and VALUE template parameters. These terms are also defined in section [17.6.3.1] of the C++11 standard. Note that, in the context of a multimap instantiation, the requirements apply specifically to the multimap's entry type, value_type, which is an alias for 'pair<const KEY, VALUE>'.
Legend ------ X - denotes an allocator-aware container type (e.g., multimap) 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 multimap's ALLOCATOR template parameter determines how that multimap will allocate memory. The multimap 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 multimap instantiation is bsl::allocator, then objects of that multimap type will conform to the standard behavior of a bslma-allocator-enabled type. Such a multimap 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 multimap throughout its lifetime; otherwise, the multimap will use the default allocator installed at the time of the multimap's construction (see bslma_default). In addition to directly allocating memory from the indicated bslma::Allocator, a multimap supplies that allocator's address to the constructors of contained objects of the (template parameter) types KEY and VALUE, if respectively, the types define the bslma::UsesBslmaAllocator trait.
Operations:
This section describes the run-time complexity of operations on instances of multimap:
  Legend
  ------
  'K'             - (template parameter) type 'KEY' of the 'multimap'
  'V'             - (template parameter) type 'VALUE' of the 'multimap'
  'a', 'b'        - two distinct objects of type 'multimap<K, V>'
  'rv'            - modifiable rvalue of type 'multimap<K, V>'
  'n', 'm'        - number of elements in 'a' and 'b', respectively
  'value_type'    - 'pair<const K, V>'
  '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
  'k'             - object of type 'K'
  'v'             - object of type 'V'
  'vt'            - object of type 'value_type'
  'rvt'           - modifiable rvalue of type 'value_type'
  'p1', 'p2'      - two 'const_iterator's belonging to 'a'
  distance(i1,i2) - number of elements in the range '[i1 .. i2)'

  +----------------------------------------------------+--------------------+
  | Operation                                          | Complexity         |
  +====================================================+====================+
  | multimap<K, V> a;        (default construction)    | O[1]               |
  | multimap<K, V> a(al);                              |                    |
  | multimap<K, V> a(c, al);                           |                    |
  +----------------------------------------------------+--------------------+
  | multimap<K, V> a(rv);    (move construction)       | O[1] if 'a' and    |
  | multimap<K, V> a(rv, al);                          | 'rv' use the same  |
  |                                                    | allocator,         |
  |                                                    | O[n] otherwise     |
  +----------------------------------------------------+--------------------+
  | multimap<K, V> a(b);     (copy construction)       | O[n]               |
  | multimap<K, V> a(b, al);                           |                    |
  +----------------------------------------------------+--------------------+
  | multimap<K, V> a(i1, i2);                          | O[N] if [i1, i2)   |
  | multimap<K, V> a(i1, i2, al);                      | is sorted with     |
  | multimap<K, V> a(i1, i2, c, al);                   | 'a.value_comp()',  |
  |                                                    | O[N * log(N)]      |
  |                                                    | otherwise, where N |
  |                                                    | is distance(i1,i2) |
  +----------------------------------------------------+--------------------+
  | a.~multimap<K, V>();     (destruction)             | O[n]               |
  +----------------------------------------------------+--------------------+
  | a = rv;                  (move assignment)         | O[1] if 'a' and    |
  |                                                    | 'rv' use the same  |
  |                                                    | allocator,         |
  |                                                    | O[n] otherwise     |
  +----------------------------------------------------+--------------------+
  | a = b;                   (copy assignment)         | O[n]               |
  +----------------------------------------------------+--------------------+
  | 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(vt)                                       | O[log(n)]          |
  | a.insert(rvt)                                      |                    |
  | a.emplace(Args&&...)                               |                    |
  +----------------------------------------------------+--------------------+
  | a.insert(p1, vt)                                   | amortized constant |
  | a.insert(p1, rvt)                                  | if the value is    |
  | a.emplace(p1, Args&&...)                           | inserted right     |
  |                                                    | before p1,         |
  |                                                    | O[log(n)]          |
  |                                                    | otherwise          |
  +----------------------------------------------------+--------------------+
  | a.insert(i1, i2)                                   | O[log(N) *         |
  |                                                    |   distance(i1,i2)] |
  |                                                    |                    |
  |                                                    | where N is         |
  |                                                    | n + distance(i1,i2)|
  +----------------------------------------------------+--------------------+
  | 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.erase(p1, p2)                                    | O[log(n) +         |
  |                                                    | distance(p1, p2)]  |
  +----------------------------------------------------+--------------------+
  | a.clear()                                          | O[n]               |
  +----------------------------------------------------+--------------------+
  | a.contains(k)                                      | O[log(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 Phone Book:
In this example, we will define a class PhoneBook, that provides a mapping of names to phone numbers. The PhoneBook class will be implemented using a bsl::multimap, and will supply manipulators, allowing a client to add or remove entries from the phone book, as well as accessors, allowing clients to efficiently lookup entries by name, and to iterate over the entries in the phone book in sorted order.
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 an alias for a pair of string objects that we will use to represent names in the phone book:
  typedef bsl::pair<string, string> FirstAndLastName;
      // This 'typedef' provides an alias for a pair of 'string' objects,
      // whose 'first' and 'second' elements refer to the first and last
      // names of a person, respectively.
Then, we define a comparison functor for FirstAndLastName objects (note that this comparator is required because we intend for the last name to take precedence over the first name in the ordering of entries maintained by the phone book, which differs from the behavior supplied by operator< for bsl::pair):
  struct FirstAndLastNameLess {
      // This 'struct' defines an ordering on 'FirstAndLastName' values,
      // allowing them to be included in sorted containers such as
      // 'bsl::multimap'.  Note that last name (the 'second' member of a
      // 'FirstAndLastName' value) takes precedence over first name in the
      // ordering defined by this functor.

      bool operator()(const FirstAndLastName& lhs,
                      const FirstAndLastName& 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.  The 'lhs' value is considered less than the 'rhs'
          // value if the second value in the 'lhs' pair (the last name) is
          // less than the second value in the 'rhs' pair or, if the second
          // values are equal, if the first value in the 'lhs' pair (the
          // first name) is less than the first value in the 'rhs' pair.
      {
          int cmp = std::strcmp(lhs.second.c_str(), rhs.second.c_str());
          if (0 == cmp) {
              cmp = std::strcmp(lhs.first.c_str(), rhs.first.c_str());
          }
          return cmp < 0;
      }
  };
Next, we define the public interface for PhoneBook:
  class PhoneBook {
      // This class provides a mapping of a person's name to their phone
      // number.  Names within a 'PhoneBook' are represented using a using
      // 'FirstAndLastName' object, and phone numbers are represented using a
      // 'bsls::Types::Uint64' value.
Here, we create a type alias, NameToNumberMap, for a bsl::multimap that will serve as the data member for a PhoneBook. A NameToNumberMap has keys of type FirstAndLastName, mapped-values of type bsls::Types::Uint64, and a comparator of type FirstAndLastNameLess. We use the default ALLOCATOR template parameter as we intend to use PhoneBook with bslma style allocators:
      // PRIVATE TYPES
      typedef bsl::multimap<FirstAndLastName,
                            bsls::Types::Uint64,
                            FirstAndLastNameLess> NameToNumberMap;
          // This 'typedef' is an alias for a mapping between names and phone
          // numbers.

      // DATA
      NameToNumberMap d_nameToNumber;  // mapping of names to phone numbers

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

    public:
      // PUBLIC TYPES
      typedef bsls::Types::Uint64 PhoneNumber;
          // This 'typedef' provides an alias for the type of an unsigned
          // integers used to represent phone-numbers in a 'PhoneBook'.

      typedef NameToNumberMap::const_iterator ConstIterator;
          // This 'typedef' provides an alias for the type of an iterator
          // providing non-modifiable access to the entries in a 'PhoneBook'.

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

      PhoneBook(const PhoneBook&  original,
                bslma::Allocator  *basicAllocator = 0);
          // Create a 'PhoneBook' 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
      PhoneBook& operator=(const PhoneBook& rhs);
          // Assign to this object the value of the specified 'rhs' object,
          // and return a reference providing modifiable access to this
          // object.

      void addEntry(const FirstAndLastName& name, PhoneNumber number);
          // Add an entry to this phone book having the specified 'name' and
          // 'number'.  The behavior is undefined unless 'name.first' and
          // 'name.end' are non-empty strings.

      int removeEntry(const FirstAndLastName& name, PhoneNumber number);
          // Remove the entries from this phone book having the specified
          // 'name' and 'number', if they exists, and return the number of
          // removed entries; otherwise, return 0 with no other effects.

      // ACCESSORS
      bsl::pair<ConstIterator, ConstIterator> lookupByName(
                                         const FirstAndLastName& name) const;
          // Return a pair of iterators to the ordered sequence of entries
          // held in this phone book having the specified 'name', where the
          // first iterator is position at the start of the sequence, and the
          // second is positioned one past the last entry in the sequence.
          // If 'name' does not exist in this phone book, then the two
          // returned iterators will have the same value.

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

      ConstIterator end() const;
          // Return an iterator providing non-modifiable access to the
          // past-the-end entry in the ordered sequence of entries maintained
          // by this phone book.

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

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

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

  inline
  void PhoneBook::addEntry(const FirstAndLastName& name, PhoneNumber number)
  {
      BSLS_ASSERT(!name.first.empty());
      BSLS_ASSERT(!name.second.empty());

      d_nameToNumber.insert(NameToNumberMap::value_type(name, number));
  }

  inline
  int PhoneBook::removeEntry(const FirstAndLastName& name,
                             PhoneNumber             number)
  {
      bsl::pair<NameToNumberMap::iterator, NameToNumberMap::iterator> range =
                                            d_nameToNumber.equal_range(name);

      NameToNumberMap::iterator it = range.first;

      int numRemovedEntries = 0;

      while (it != range.second) {
          if (it->second == number) {
              it = d_nameToNumber.erase(it);
              ++numRemovedEntries;
          }
          else {
              ++it;
          }
      }

      return numRemovedEntries;
  }

  // ACCESSORS
  inline
  bsl::pair<PhoneBook::ConstIterator, PhoneBook::ConstIterator>
  PhoneBook::lookupByName(const FirstAndLastName&  name) const
  {
      return d_nameToNumber.equal_range(name);
  }

  inline
  PhoneBook::ConstIterator PhoneBook::begin() const
  {
      return d_nameToNumber.begin();
  }

  inline
  PhoneBook::ConstIterator PhoneBook::end() const
  {
      return d_nameToNumber.end();
  }

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

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

Typedef Documentation

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

Function Documentation

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

Create a data wrapper using a copy of the specified comparator to order key-value pairs and a copy of the specified basicAllocator to supply memory.

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

IMPLICIT: 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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
NodeFactory& bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::DataWrapper::nodeFactory (  )  [inherited]

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

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const NodeFactory& bsl::multimap< KEY, VALUE, 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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::value_compare::value_compare ( COMPARATOR  comparator  )  [protected, inherited]

IMPLICIT: Create a value_compare object that uses the specified comparator.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::value_compare::value_compare ( const value_compare original  )  [inherited]

Create a value_compare object having the same value as the specified original object.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::value_compare::~value_compare (  )  [inherited]

Destroy this object.

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

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bool bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::value_compare::operator() ( const value_type x,
const value_type y 
) const [inherited]

Return true if the specified x object is ordered before the specified y object, as determined by the comparator supplied at construction, and false otherwise.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::multimap (  )  [inherited]
template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::multimap ( const COMPARATOR &  comparator,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
) [inline, explicit, inherited]
Parameters:
basicAllocator Create an empty multimap. Optionally specify a comparator used to order key-value pairs 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 (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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::multimap ( const ALLOCATOR &  basicAllocator  )  [explicit, inherited]

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

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

Create a multimap having the same value as the specified original object. Use a copy of original.key_comp() to order the key-value pairs contained in this multimap. 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) types KEY and VALUE both be copy-insertable into this multimap (see Requirements on KEY and VALUE).

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

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

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

Create a multimap 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 key-value pairs contained in this multimap. This method requires that the (template parameter) types KEY and VALUE both be copy-insertable into this multimap (see Requirements on KEY and VALUE). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).

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

Create a multimap 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 multimap 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 key-value pairs contained in this multimap. This method requires that the (template parameter) types KEY and VALUE both be move-insertable into this multimap (see Requirements on KEY and VALUE). Note that a 'bslmaAllocator *' can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).

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

Create a multimap, 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 key-value pairs 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 (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. 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 multimap, where i is a dereferenceable iterator in the range [first .. last) (see Requirements on KEY and VALUE). 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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::multimap ( std::initializer_list< value_type values,
const COMPARATOR &  comparator = COMPARATOR(),
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
) [inherited]
template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::multimap ( std::initializer_list< value_type values,
const ALLOCATOR &  basicAllocator 
) [inherited]

Create a multimap 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 (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. 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) types KEY and VALUE both be copy-insertable into this multimap (see Requirements on KEY and VALUE).

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

Destroy this object.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
multimap& bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::operator= ( const multimap< KEY, VALUE, 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) types KEY and VALUE both be copy-assignable and copy-insertable into this multimap (see Requirements on KEY and VALUE).

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
multimap& operator= (BloombergLP::bslmf::MovableRef<multimap> rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION( AllocatorTraits multimap& bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::operator= ( std::initializer_list< value_type 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 multimap if get_allocator() == rhs.get_allocator() (after accounting for the aforementioned trait); otherwise, all elements in this multimap are either destroyed or move-assigned to and each additional element in rhs is move-inserted into this multimap. 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) types KEY and VALUE both be move-assignable and move-insertable into this multimap (see Requirements on KEY and VALUE). Assign to this object the value resulting from first clearing this multimap 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) types KEY and VALUE both be copy-insertable into this multimap (see Requirements on KEY and VALUE).

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
iterator bsl::multimap< KEY, VALUE, 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 multimap, or the end iterator if this multimap is empty.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
iterator bsl::multimap< KEY, VALUE, 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 multimap.

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

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
reverse_iterator bsl::multimap< KEY, VALUE, 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 multimap, or rend if this multimap is empty.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
reverse_iterator bsl::multimap< KEY, VALUE, 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 multimap.

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

Insert the specified value into this multimap. 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) types KEY and VALUE both be copy-insertable into this multimap (see Requirements on KEY and VALUE).

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class ALT_VALUE_TYPE >
enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value, iterator>::type bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE)  value  )  [inline, inherited]
Parameters:
value Insert into this multimap a value_type object created from the specified value. If a range containing elements equivalent to value_type object already exists, insert the value_type object at the end of that range. Return an iterator referring to the newly inserted value_type object. This method requires that the (template parameter) types KEY and VALUE both be move-insertable into this multimap (see Requirements on KEY and VALUE), and the value_type be constructible from the (template parameter) ALT_VALUE_TYPE.

References BSLS_COMPILERFEATURES_FORWARD, and bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::emplace().

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

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

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class ALT_VALUE_TYPE >
enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value, iterator>::type bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( const_iterator  hint,
BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE)  value 
) [inline, inherited]
Parameters:
value Insert into this multimap a value_type object created from the specified value (in amortized constant time if the specified hint is a valid immediate successor to the object created from value). Return an iterator referring to the newly inserted value_type object in this multimap. If hint is not a valid immediate successor to the object created from value, this operation has O[log(N)] complexity, where N is the size of this multimap. This method requires that the (template parameter) types KEY and VALUE both be move-insertable into this multimap (see Requirements on KEY and VALUE), and the value_type be constructible from the (template parameter) ALT_VALUE_TYPE. The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).

References BSLS_COMPILERFEATURES_FORWARD, and bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::emplace_hint().

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

Insert into this multimap 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 multimap, where i is a dereferenceable iterator in the range [first .. last) (see Requirements on KEY and VALUE). 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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
void bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( std::initializer_list< value_type values  )  [inherited]

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

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

Insert into this multimap 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 multimap. This method requires that the (template parameter) types KEY and VALUE both be emplace-constructible from args (see Requirements on KEY and VALUE).

Referenced by bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert().

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

Insert into this multimap 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 multimap. 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 multimap. This method requires that the (template parameter) types KEY and VALUE both be emplace-constructible from args (see Requirements on KEY and VALUE). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).

Referenced by bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert().

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

Remove from this multimap 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 multimap. 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 multimap.

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

Remove from this multimap all value_type objects whose keys are equivalent to the specified key, if such entries exist, and return the number of erased objects; otherwise, if there is no value_type objects having an equivalent 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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
iterator bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::erase ( const_iterator  first,
const_iterator  last 
) [inherited]

Remove from this multimap the value_type objects starting at the specified first position up to, but 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 multimap 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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
iterator bsl::multimap< KEY, VALUE, 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 multimap whose key is equivalent to the specified key, if such an entry exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

Referenced by bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::contains().

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, iterator>::type bsl::multimap< KEY, VALUE, 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 multimap whose key is equivalent to the specified key, if such an entry exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
iterator bsl::multimap< KEY, VALUE, 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 multimap whose key is greater-than or equal-to the specified key, and the past-the-end iterator if this multimap does not contain a value_type object whose key is greater-than or equal-to key. Note that this function returns the first position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this multimap, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

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

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, iterator>::type bsl::multimap< KEY, VALUE, 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 multimap whose key is greater-than or equal-to the specified key, and the past-the-end iterator if this multimap does not contain a value_type object whose key is greater-than or equal-to key. Note that this function returns the first position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this multimap, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
iterator bsl::multimap< KEY, VALUE, 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 multimap whose key is greater than the specified key, and the past-the-end iterator if this multimap does not contain a value_type object whose key is greater-than key. Note that this function returns the last position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this multimap, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

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

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, iterator>::type bsl::multimap< KEY, VALUE, 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 multimap whose key is greater than the specified key, and the past-the-end iterator if this multimap does not contain a value_type object whose key is greater-than key. Note that this function returns the last position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this multimap, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::pair<iterator,iterator> bsl::multimap< KEY, VALUE, 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 multimap whose keys 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 multimap contains no value_type object 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::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::end(), bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::lower_bound(), and bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::upper_bound().

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, pair<iterator, iterator> >::type bsl::multimap< KEY, VALUE, 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 multimap whose keys 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 multimap contains no value_type object 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::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::end(), bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::lower_bound(), and bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::upper_bound().

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

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

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_iterator bsl::multimap< KEY, VALUE, 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 multimap, or the end iterator if this multimap is empty.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_iterator bsl::multimap< KEY, VALUE, 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 multimap.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_reverse_iterator bsl::multimap< KEY, VALUE, 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 multimap, or rend if this multimap is empty.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_reverse_iterator bsl::multimap< KEY, VALUE, 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 multimap.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_iterator bsl::multimap< KEY, VALUE, 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 multimap, or the cend iterator if this multimap is empty.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_iterator bsl::multimap< KEY, VALUE, 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 multimap.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_reverse_iterator bsl::multimap< KEY, VALUE, 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 multimap, or rend if this multimap is empty.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_reverse_iterator bsl::multimap< KEY, VALUE, 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 multimap.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bool bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::contains ( const key_type key  )  const [inherited]

Return true if this multimap contains an element whose key is equivalent to the specified key.

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

< Return true if this multimap contains an element whose key is equivalent to the specified key.

Note: implemented inline due to Sun CC compilation error

References bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::end(), and bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::find().

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

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

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

Return the number of elements in this multimap.

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

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

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

Return the key-comparison functor (or function pointer) used by this multimap; 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 key part of the value_type objects contained in this multimap.

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

Return a functor for comparing two value_type objects by comparing their respective keys using key_comp(). Note that this comparator compares objects of type value_type (i.e., 'pair<const KEY, VALUE>').

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

< Return an iterator providing non-modifiable access to the first value_type object having the specified key in the ordered sequence maintained by this multimap, 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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, const_iterator>::type bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::find ( const LOOKUP_KEY &  key  )  const [inline, inherited]

< Return an iterator providing non-modifiable access to the first value_type object having the specified key in the ordered sequence maintained by this multimap, 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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
size_type bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::count ( const key_type key  )  const [inline, inherited]

< Return the number of value_type objects within this multimap whose keys are equivalent to the specified key.

Note: implemented inline due to Sun CC compilation error.

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

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

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

< Return the number of value_type objects within this multimap whose keys are equivalent to the specified key.

Note: implemented inline due to Sun CC compilation error.

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

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_iterator bsl::multimap< KEY, VALUE, 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 multimap whose key is greater-than or equal-to the specified key, and the past-the-end iterator if this multimap does not contain a value_type object whose key is greater-than or equal-to key. Note that this function returns the first position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this multimap, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, const_iterator>::type bsl::multimap< KEY, VALUE, 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 multimap whose key is greater-than or equal-to the specified key, and the past-the-end iterator if this multimap does not contain a value_type object whose key is greater-than or equal-to key. Note that this function returns the first position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this multimap, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_iterator bsl::multimap< KEY, VALUE, 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 multimap whose key is greater than the specified key, and the past-the-end iterator if this multimap does not contain a value_type object whose key is greater-than key. Note that this function returns the last position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this multimap, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, const_iterator>::type bsl::multimap< KEY, VALUE, 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 multimap whose key is greater than the specified key, and the past-the-end iterator if this multimap does not contain a value_type object whose key is greater-than key. Note that this function returns the last position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this multimap, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
pair<const_iterator, const_iterator> bsl::multimap< KEY, VALUE, 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 multimap whose keys are equivalent to the specified key, where the first iterator is positioned at the start of the sequence and the second iterator 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 multimap contains no value_type objects having keys equivalent to key, then the two returned iterators will have the same value.

Note: implemented inline due to Sun CC compilation error.

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

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value, pair<const_iterator, const_iterator> >::type bsl::multimap< KEY, VALUE, 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 multimap whose keys are equivalent to the specified key, where the first iterator is positioned at the start of the sequence and the second iterator 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 multimap contains no value_type objects having keys equivalent to key, then the two returned iterators will have the same value.

Note: implemented inline due to Sun CC compilation error.

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

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

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

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

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

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

Return true if the value of the specified lhs multimap is lexicographically less than that of the specified rhs multimap, and false otherwise. Given iterators i and j over the respective sequences [lhs.begin() .. lhs.end()) and [rhs.begin() .. rhs.end()), the value of multimap lhs is lexicographically less than that of multimap 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 VALUE , class COMPARATOR , class ALLOCATOR >
bool bsl::operator> ( const multimap< KEY, VALUE, COMPARATOR, ALLOCATOR > &  lhs,
const multimap< KEY, VALUE, COMPARATOR, ALLOCATOR > &  rhs 
)

Return true if the value of the specified lhs multimap is lexicographically greater than that of the specified rhs multimap, and false otherwise. The value of multimap lhs is lexicographically greater than that of multimap 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 VALUE , class COMPARATOR , class ALLOCATOR >
bool bsl::operator<= ( const multimap< KEY, VALUE, COMPARATOR, ALLOCATOR > &  lhs,
const multimap< KEY, VALUE, COMPARATOR, ALLOCATOR > &  rhs 
)

Return true if the value of the specified lhs multimap is lexicographically less than or equal to that of the specified rhs multimap, and false otherwise. The value of multimap lhs is lexicographically less than or equal to that of multimap 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 VALUE , class COMPARATOR , class ALLOCATOR >
bool bsl::operator>= ( const multimap< KEY, VALUE, COMPARATOR, ALLOCATOR > &  lhs,
const multimap< KEY, VALUE, COMPARATOR, ALLOCATOR > &  rhs 
)

Return true if the value of the specified lhs multimap is lexicographically greater than or equal to that of the specified rhs multimap, and false otherwise. The value of multimap lhs is lexicographically greater than or equal to that of multimap 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 VALUE , class COMPARATOR , class ALLOCATOR >
void bsl::swap ( multimap< KEY, VALUE, COMPARATOR, ALLOCATOR > &  a,
multimap< KEY, VALUE, 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 VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
COMPARATOR bsl::multimap< KEY, VALUE, COMPARATOR, ALLOCATOR >::value_compare::comp [protected, inherited]

we would not have elected to make this data

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
void swap (multimap& other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION( AllocatorTraits void bsl::multimap< KEY, VALUE, 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 multimap. Note that the multimap is empty after this call, but allocated memory may be retained for future use.