[#bsl-multiset-03] = xref:bsl.adoc[bsl]::multiset :relfileprefix: ../ :mrdocs: 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>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class COMPARATOR = std::less<KEY>, class ALLOCATOR = xref:bsl/allocator-0df.adoc[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 [cols="1,4"] |=== | Name| Description | xref:bsl/multiset-03/allocator_type.adoc[`allocator_type`] | This `typedef` is an alias to the (template parameter) `ALLOCATOR`. | xref:bsl/multiset-03/const_iterator.adoc[`const_iterator`] | This `typedef` is an alias to `iterator`. | xref:bsl/multiset-03/const_pointer.adoc[`const_pointer`] | This `typedef` is an alias to the allocator const‐pointer type. | xref:bsl/multiset-03/const_reference.adoc[`const_reference`] | This `typedef` is an alias for `const_reference`. | xref:bsl/multiset-03/const_reverse_iterator.adoc[`const_reverse_iterator`] | This `typedef` is an alias to the const reverse iterator type. | xref:bsl/multiset-03/difference_type.adoc[`difference_type`] | This `typedef` is an alias to the allocator difference type. | xref:bsl/multiset-03/iterator.adoc[`iterator`] | This `typedef` is an alias to the red‐black tree iterator type. | xref:bsl/multiset-03/key_compare.adoc[`key_compare`] | This `typedef` is an alias to the (template parameter) `COMPARATOR`. | xref:bsl/multiset-03/key_type.adoc[`key_type`] | This `typedef` is an alias to the (template parameter) `KEY` type. | xref:bsl/multiset-03/pointer.adoc[`pointer`] | This `typedef` is an alias to the allocator pointer type. | xref:bsl/multiset-03/reference.adoc[`reference`] | This `typedef` is an alias to `value_type&`. | xref:bsl/multiset-03/reverse_iterator.adoc[`reverse_iterator`] | This `typedef` is an alias to the reverse iterator type. | xref:bsl/multiset-03/size_type.adoc[`size_type`] | This `typedef` is an alias to the allocator size type. | xref:bsl/multiset-03/value_compare.adoc[`value_compare`] | This `typedef` is an alias to `key_compare`. | xref:bsl/multiset-03/value_type.adoc[`value_type`] | This `typedef` is an alias to `key_type`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/multiset-03/2constructor-05.adoc[`multiset`] [.small]#[constructor]# | Constructors | xref:bsl/multiset-03/2destructor.adoc[`~multiset`] [.small]#[destructor]# | Destroy this object. | xref:bsl/multiset-03/operator_assign-09.adoc[`operator=`] | Assignment operators | xref:bsl/multiset-03/begin-00.adoc[`begin`] | `begin` overloads | xref:bsl/multiset-03/cbegin.adoc[`cbegin`] | Return a const iterator to the first element, or `cend` if empty. | xref:bsl/multiset-03/cend.adoc[`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. | xref:bsl/multiset-03/clear.adoc[`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. | xref:bsl/multiset-03/contains-0b.adoc[`contains`] | Return whether this multiset contains an element equivalent to `key`. | xref:bsl/multiset-03/count-064.adoc[`count`] | Return the number of elements equivalent to `key`. | xref:bsl/multiset-03/crbegin.adoc[`crbegin`] | Return a const reverse iterator to the last element, or `crend`. | xref:bsl/multiset-03/crend.adoc[`crend`] | Return a const reverse iterator to prior‐to‐beginning. | xref:bsl/multiset-03/emplace.adoc[`emplace`] | Emplace a newly constructed element into this multiset. | xref:bsl/multiset-03/emplace_hint.adoc[`emplace_hint`] | Emplace a newly constructed element near `hint`. | xref:bsl/multiset-03/empty.adoc[`empty`] | Return `true` if this multiset contains no elements, and `false` otherwise. | xref:bsl/multiset-03/end-05.adoc[`end`] | `end` overloads | xref:bsl/multiset-03/equal_range-00.adoc[`equal_range`] | `equal_range` overloads | xref:bsl/multiset-03/erase-0f.adoc[`erase`] | `erase` overloads | xref:bsl/multiset-03/find-0b.adoc[`find`] | `find` overloads | xref:bsl/multiset-03/get_allocator.adoc[`get_allocator`] | Return (a copy of) the allocator used for memory allocation by this multiset. | xref:bsl/multiset-03/insert-07.adoc[`insert`] | `insert` overloads | xref:bsl/multiset-03/insert_range.adoc[`insert_range`] | Insert each element from the specified `range`. | xref:bsl/multiset-03/key_comp.adoc[`key_comp`] | Return the key‐comparison functor used by this multiset. | xref:bsl/multiset-03/lower_bound-04.adoc[`lower_bound`] | `lower_bound` overloads | xref:bsl/multiset-03/max_size.adoc[`max_size`] | Return a theoretical upper bound on this multiset's size. | xref:bsl/multiset-03/rbegin-01.adoc[`rbegin`] | `rbegin` overloads | xref:bsl/multiset-03/rend-0f.adoc[`rend`] | `rend` overloads | xref:bsl/multiset-03/size.adoc[`size`] | Return the number of elements in this multiset. | xref:bsl/multiset-03/swap.adoc[`swap`] | Exchange the value and comparator with `other`. | xref:bsl/multiset-03/upper_bound-0e.adoc[`upper_bound`] | `upper_bound` overloads | xref:bsl/multiset-03/value_comp.adoc[`value_comp`] | Return a functor for comparing two `value_type` objects. |=== == Deduction Guides [cols="1,4"] |=== | Name| Description | xref:bsl/multiset-02.adoc[`multiset<KEY>`] | Deduce `KEY` from an initializer list with `ALLOC *`. | xref:bsl/multiset-06a.adoc[`multiset<KEY>`] | Deduce `KEY` from iterator construction with `ALLOC *`. | xref:bsl/multiset-005.adoc[`multiset<KEY, COMPARATOR>`] | Deduce `KEY` and `COMPARATOR` from an initializer list with `ALLOC *`. | xref:bsl/multiset-0a.adoc[`multiset<KEY, COMPARATOR>`] | Deduce `KEY` and `COMPARATOR` from iterator construction with `ALLOC *`. | xref:bsl/multiset-05.adoc[`multiset<KEY, COMPARATOR, ALLOCATOR>`] | Deduce `KEY`, `COMPARATOR`, and `ALLOCATOR` from an initializer list. | xref:bsl/multiset-060.adoc[`multiset<KEY, COMPARATOR, ALLOCATOR>`] | Deduce `KEY`, `COMPARATOR`, and `ALLOCATOR` from iterator construction. | xref:bsl/multiset-00e.adoc[`multiset<KEY, std::less<KEY>, ALLOCATOR>`] | Deduce `KEY` and `ALLOCATOR` from an initializer‐list constructor. | xref:bsl/multiset-0f.adoc[`multiset<KEY, std::less<KEY>, ALLOCATOR>`] | Deduce `KEY` and `ALLOCATOR` from iterator‐pair construction. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/erase_if-030.adoc[`erase_if`] | Erase all elements in `ms` that satisfy `predicate`. | xref:bsl/operator_3way-0ff.adoc[`operator<=>`] | Return the lexicographic three‐way comparison of `lhs` and `rhs`. | xref:bsl/operator_eq-0a8.adoc[`operator==`] | Return `true` if `lhs` and `rhs` have the same value. | xref:bsl/swap-001.adoc[`swap`] | Exchange the values of the specified `a` and `b` multisets. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#