multiset

allocator_type · begin · clear · const_iterator · const_reference · const_reverse_iterator · count · difference_type · empty · end · equal_range · erase · find · get_allocator · insert · iterator · key_comp · key_compare · key_type · lower_bound · max_size · multiset · rbegin · reference · rend · reverse_iterator · size · size_type · swap · upper_bound · value_comp · value_compare · value_type

template<class Key, class Pred = less<Key>, class A = allocator<Key> >
    class multiset {
public:
    typedef Key key_type;
    typedef Pred key_compare;
    typedef Key value_type;
    typedef Pred value_compare;
    typedef A allocator_type;
    typedef A::size_type size_type;
    typedef A::difference_type difference_type;
    typedef A::rebind<value_type>::other::const_reference reference;
    typedef A::rebind<value_type>::other::const_reference const_reference;
    typedef T0 iterator;
    typedef T1 const_iterator;
    typedef reverse_bidirectional_iterator<iterator,
        value_type, reference, A::const_pointer,
            difference_type> reverse_iterator;
    typedef reverse_bidirectional_iterator<const_iterator,
        value_type, const_reference, A::pointer,
            difference_type> const_reverse_iterator;
    explicit multiset(const Pred& comp = Pred(), const A& al = A());
    multiset(const multiset& x);
    multiset(const value_type *first, const value_type *last,
        const Pred& comp = Pred(), const A& al = A());
    const_iterator begin() const;
    iterator end() const;
    const_reverse_iterator rbegin() const;
    const_reverse_iterator rend() const;
    size_type size() const;
    size_type max_size() const;
    bool empty() const;
    A get_allocator() const;
    iterator insert(const value_type& x);
    iterator insert(iterator it, const value_type& x);
    void insert(const value_type *first, const value_type *last);
    iterator erase(iterator it);
    iterator erase(iterator first, iterator last);
    size_type erase(const Key& key);
    void clear();
    void swap(multiset x);
    key_compare key_comp() const;
    value_compare value_comp() const;
    const_iterator find(const Key& key) const;
    size_type count(const Key& key) const;
    const_iterator lower_bound(const Key& key) const;
    const_iterator upper_bound(const Key& key) const;
    pair<const_iterator, const_iterator>
        equal_range(const Key& key) const;
protected:
    A allocator;
    };

The template class describes an object that controls a varying-length sequence of elements of type const Key. Each element serves as both a sort key and a 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 that 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 order on sort keys. For any element x that precedes y in the sequence, key_comp()(y, x) is false. (For the default function object less<Key>, sort keys never decrease in value.) Unlike template class set, an object of template class multiset does not ensure that key_comp()(x, y) is true. (Keys need not be unique.)

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