Description

The template class describes an object that controls a varying-length sequence of elements of type pair<const Key, T>. The sequence is ordered by the predicate Pred. The first element of each pair is the sort key and the second is its associated value. The sequence is represented in a way that permits lookup, insertion, and removal of an arbitrary element with a number of operations proportional to the logarithm of the number of elements in the sequence (logarithmic time). Moreover, inserting an element invalidates no iterators, and removing an element invalidates only those iterators which point at the removed element.

The object orders the sequence it controls by calling a stored function object of type Pred. You access this stored object by calling the member function key_comp(). Such a function object must impose a total ordering on sort keys of type Key. For any element x that precedes y in the sequence, key_comp()(y.first, x.first) is false. (For the default function object less<Key>, sort keys never decrease in value.) Unlike template class map, an object of template class multimap does not ensure that key_comp()(x.first, y.first) is true. (Keys need not be unique.)

The object allocates and frees storage for the sequence it controls through a stored allocator object of class A. Such an allocator object must have the same external interface as an object of template class allocator. Note that the stored allocator object is not copied when the container object is assigned.