Next : , Previous : Set, Top : Table of Contents


Multiset

multiset Associative Container

multiset is a kind of associative container (See Associative containers) that supports equal keys (possibly contains multiple copies of the same key value) and provides for fast retrieval of the keys themselves. See Reversible Container.


template ,
          template  class Allocator = allocator>
class multiset {
public:

// typedefs:
typedef Key key_type;
    typedef Key value_type;
    typedef Allocator::pointer pointer;
    typedef Allocator::reference reference;
    typedef Allocator::const_reference const_reference;
    typedef Compare key_compare;
    typedef Compare value_compare;
    typedef iterator;
    typedef iterator const_iterator;
    typedef size_type;
    typedef difference_type;
    typedef reverse_iterator;
    typedef const_reverse_iterator;

// allocation/deallocation:
    multiset(const Compare& comp = Compare());
    template 
    multiset(InputIterator first, InputIterator last,
             const Compare& comp = Compare());
    multiset(const multiset& x);
    ~multiset();
    multiset& operator=(const multiset& x);
    void swap(multiset& x);

// accessors:
    key_compare key_comp() const;
    value_compare value_comp() const;
    iterator begin() const;
    iterator end() const;
    reverse_iterator rbegin();
    reverse_iterator rend();
    bool empty() const;
    size_type size() const;
    size_type max_size() const;

// insert/erase:
    iterator insert(const value_type& x);
    iterator insert(iterator position, const value_type& x);
    template 
    void insert(InputIterator first, InputIterator last);
    void erase(iterator position);
    size_type erase(const key_type& x);
    void erase(iterator first, iterator last);

// multiset operations:
    iterator find(const key_type& x) const;
    size_type count(const key_type& x) const;
    iterator lower_bound(const key_type& x) const;
    iterator upper_bound(const key_type& x) const;
    pair equal_range(const key_type& x) const;
};

template 
bool operator==(const multiset& x,
                const multiset& y);

template 
bool operator<(const multiset& x,
               const multiset& y);
iterator Typedef on multiset
const_iterator Typedef on multiset
iterator is a constant bidirectional iterator referring to const value_type. The exact type is implementation dependent and determined by Allocator. const_iterator is the same type as iterator.

size_type Typedef on multiset

size_type is an unsigned integral type. The exact type is implementation dependent and determined by Allocator.

difference_type Typedef on multiset

difference_type is a signed integral type. The exact type is implementation dependent and determined by Allocator.