This class template implements a value‐semantic container type holding an ordered sequence of possibly duplicate keys (of the template parameter type, KEY).

Synopsis

Declared in <bslstl_multiset.h>

template<
    class KEY,
    class COMPARATOR = std::less<KEY>,
    class ALLOCATOR = bsl::allocator<KEY>>
class multiset;

Description

This class: * supports a complete set of value‐semantic operations

  • except for BDEX serialization * is exception‐neutral (agnostic except for the at method) * is alias‐safe * is const thread‐safe For terminology see {`bsldoc_glossary`}.

Type Aliases

Name

Description

allocator_type

This typedef is an alias to the (template parameter) ALLOCATOR.

const_iterator

This typedef is an alias to iterator.

const_pointer

This typedef is an alias to the allocator const‐pointer type.

const_reference

This typedef is an alias for const_reference.

const_reverse_iterator

This typedef is an alias to the const reverse iterator type.

difference_type

This typedef is an alias to the allocator difference type.

iterator

This typedef is an alias to the red‐black tree iterator type.

key_compare

This typedef is an alias to the (template parameter) COMPARATOR.

key_type

This typedef is an alias to the (template parameter) KEY type.

pointer

This typedef is an alias to the allocator pointer type.

reference

This typedef is an alias to value_type&.

reverse_iterator

This typedef is an alias to the reverse iterator type.

size_type

This typedef is an alias to the allocator size type.

value_compare

This typedef is an alias to key_compare.

value_type

This typedef is an alias to key_type.

Member Functions

Name

Description

multiset [constructor]

Constructors

~multiset [destructor]

Destroy this object.

operator=

Assignment operators

begin

begin overloads

cbegin

Return a const iterator to the first element, or cend if empty.

cend

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

clear

Remove all entries from this multiset. Note that the multiset is empty after this call, but allocated memory may be retained for future use.

contains

Return whether this multiset contains an element equivalent to key.

count

Return the number of elements equivalent to key.

crbegin

Return a const reverse iterator to the last element, or crend.

crend

Return a const reverse iterator to prior‐to‐beginning.

emplace

Emplace a newly constructed element into this multiset.

emplace_hint

Emplace a newly constructed element near hint.

empty

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

end

end overloads

equal_range

equal_range overloads

erase

erase overloads

find

find overloads

get_allocator

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

insert

insert overloads

insert_range

Insert each element from the specified range.

key_comp

Return the key‐comparison functor used by this multiset.

lower_bound

lower_bound overloads

max_size

Return a theoretical upper bound on this multiset's size.

rbegin

rbegin overloads

rend

rend overloads

size

Return the number of elements in this multiset.

swap

Exchange the value and comparator with other.

upper_bound

upper_bound overloads

value_comp

Return a functor for comparing two value_type objects.

Deduction Guides

Name

Description

multiset<KEY>

Deduce KEY from an initializer list with ALLOC *.

multiset<KEY>

Deduce KEY from iterator construction with ALLOC *.

multiset<KEY, COMPARATOR>

Deduce KEY and COMPARATOR from an initializer list with ALLOC *.

multiset<KEY, COMPARATOR>

Deduce KEY and COMPARATOR from iterator construction with ALLOC *.

multiset<KEY, COMPARATOR, ALLOCATOR>

Deduce KEY, COMPARATOR, and ALLOCATOR from an initializer list.

multiset<KEY, COMPARATOR, ALLOCATOR>

Deduce KEY, COMPARATOR, and ALLOCATOR from iterator construction.

multiset<KEY, std::less<KEY>, ALLOCATOR>

Deduce KEY and ALLOCATOR from an initializer‐list constructor.

multiset<KEY, std::less<KEY>, ALLOCATOR>

Deduce KEY and ALLOCATOR from iterator‐pair construction.

Non-Member Functions

Name

Description

erase_if

Erase all elements in ms that satisfy predicate.

operator<=>

Return the lexicographic three‐way comparison of lhs and rhs.

operator==

Return true if lhs and rhs have the same value.

swap

Exchange the values of the specified a and b multisets.

Created with MrDocs