[#bsl-multiset-03]
= xref:bsl.adoc[bsl]::multiset
:relfileprefix: ../
:mrdocs:

This class template implements a value&hyphen;semantic container type holding an ordered sequence of possibly duplicate keys (of the template parameter type, `KEY`)&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;multiset&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class COMPARATOR = std::less&lt;KEY&gt;,
    class ALLOCATOR = xref:bsl/allocator-0df.adoc[bsl::allocator&lt;KEY&gt;]&gt;
class multiset;
----

== Description

This class&colon; &ast; supports a complete set of _value&hyphen;semantic_ operations

* except for BDEX serialization &ast; is _exception&hyphen;neutral_ (agnostic except for the `at` method) &ast; is _alias&hyphen;safe_ &ast; is `const` _thread&hyphen;safe_ For terminology see &lcub;`bsldoc&lowbar;glossary`&rcub;&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/multiset-03/allocator_type.adoc[`allocator&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `ALLOCATOR`&period;
| xref:bsl/multiset-03/const_iterator.adoc[`const&lowbar;iterator`] 
| This `typedef` is an alias to `iterator`&period;
| xref:bsl/multiset-03/const_pointer.adoc[`const&lowbar;pointer`] 
| This `typedef` is an alias to the allocator const&hyphen;pointer type&period;
| xref:bsl/multiset-03/const_reference.adoc[`const&lowbar;reference`] 
| This `typedef` is an alias for `const&lowbar;reference`&period;
| xref:bsl/multiset-03/const_reverse_iterator.adoc[`const&lowbar;reverse&lowbar;iterator`] 
| This `typedef` is an alias to the const reverse iterator type&period;
| xref:bsl/multiset-03/difference_type.adoc[`difference&lowbar;type`] 
| This `typedef` is an alias to the allocator difference type&period;
| xref:bsl/multiset-03/iterator.adoc[`iterator`] 
| This `typedef` is an alias to the red&hyphen;black tree iterator type&period;
| xref:bsl/multiset-03/key_compare.adoc[`key&lowbar;compare`] 
| This `typedef` is an alias to the (template parameter) `COMPARATOR`&period;
| xref:bsl/multiset-03/key_type.adoc[`key&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `KEY` type&period;
| xref:bsl/multiset-03/pointer.adoc[`pointer`] 
| This `typedef` is an alias to the allocator pointer type&period;
| xref:bsl/multiset-03/reference.adoc[`reference`] 
| This `typedef` is an alias to `value&lowbar;type&amp;`&period;
| xref:bsl/multiset-03/reverse_iterator.adoc[`reverse&lowbar;iterator`] 
| This `typedef` is an alias to the reverse iterator type&period;
| xref:bsl/multiset-03/size_type.adoc[`size&lowbar;type`] 
| This `typedef` is an alias to the allocator size type&period;
| xref:bsl/multiset-03/value_compare.adoc[`value&lowbar;compare`] 
| This `typedef` is an alias to `key&lowbar;compare`&period;
| xref:bsl/multiset-03/value_type.adoc[`value&lowbar;type`] 
| This `typedef` is an alias to `key&lowbar;type`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/multiset-03/2constructor-05.adoc[`multiset`]         [.small]#[constructor]#
| Constructors
| xref:bsl/multiset-03/2destructor.adoc[`&#126;multiset`] [.small]#[destructor]#
| Destroy this object&period;
| xref:bsl/multiset-03/operator_assign-09.adoc[`operator&equals;`] 
| 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&period;
| xref:bsl/multiset-03/cend.adoc[`cend`] 
| Return an iterator providing non&hyphen;modifiable access to the past&hyphen;the&hyphen;end element in the ordered sequence of `value&lowbar;type` objects maintained by this multiset&period;
| xref:bsl/multiset-03/clear.adoc[`clear`] 
| Remove all entries from this multiset&period; Note that the multiset is empty after this call, but allocated memory may be retained for future use&period;
| xref:bsl/multiset-03/contains-0b.adoc[`contains`] 
| Return whether this multiset contains an element equivalent to `key`&period;
| xref:bsl/multiset-03/count-064.adoc[`count`] 
| Return the number of elements equivalent to `key`&period;
| xref:bsl/multiset-03/crbegin.adoc[`crbegin`] 
| Return a const reverse iterator to the last element, or `crend`&period;
| xref:bsl/multiset-03/crend.adoc[`crend`] 
| Return a const reverse iterator to prior&hyphen;to&hyphen;beginning&period;
| xref:bsl/multiset-03/emplace.adoc[`emplace`] 
| Emplace a newly constructed element into this multiset&period;
| xref:bsl/multiset-03/emplace_hint.adoc[`emplace&lowbar;hint`] 
| Emplace a newly constructed element near `hint`&period;
| xref:bsl/multiset-03/empty.adoc[`empty`] 
| Return `true` if this multiset contains no elements, and `false` otherwise&period;
| xref:bsl/multiset-03/end-05.adoc[`end`] 
| `end` overloads
| xref:bsl/multiset-03/equal_range-00.adoc[`equal&lowbar;range`] 
| `equal&lowbar;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&lowbar;allocator`] 
| Return (a copy of) the allocator used for memory allocation by this multiset&period;
| xref:bsl/multiset-03/insert-07.adoc[`insert`] 
| `insert` overloads
| xref:bsl/multiset-03/insert_range.adoc[`insert&lowbar;range`] 
| Insert each element from the specified `range`&period;
| xref:bsl/multiset-03/key_comp.adoc[`key&lowbar;comp`] 
| Return the key&hyphen;comparison functor used by this multiset&period;
| xref:bsl/multiset-03/lower_bound-04.adoc[`lower&lowbar;bound`] 
| `lower&lowbar;bound` overloads
| xref:bsl/multiset-03/max_size.adoc[`max&lowbar;size`] 
| Return a theoretical upper bound on this multiset&apos;s size&period;
| 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&period;
| xref:bsl/multiset-03/swap.adoc[`swap`] 
| Exchange the value and comparator with `other`&period;
| xref:bsl/multiset-03/upper_bound-0e.adoc[`upper&lowbar;bound`] 
| `upper&lowbar;bound` overloads
| xref:bsl/multiset-03/value_comp.adoc[`value&lowbar;comp`] 
| Return a functor for comparing two `value&lowbar;type` objects&period;
|===


== Deduction Guides

[cols="1,4"]
|===
| Name| Description
| xref:bsl/multiset-02.adoc[`multiset&lt;KEY&gt;`] 
| Deduce `KEY` from an initializer list with `ALLOC &ast;`&period;
| xref:bsl/multiset-06a.adoc[`multiset&lt;KEY&gt;`] 
| Deduce `KEY` from iterator construction with `ALLOC &ast;`&period;
| xref:bsl/multiset-005.adoc[`multiset&lt;KEY, COMPARATOR&gt;`] 
| Deduce `KEY` and `COMPARATOR` from an initializer list with `ALLOC &ast;`&period;
| xref:bsl/multiset-0a.adoc[`multiset&lt;KEY, COMPARATOR&gt;`] 
| Deduce `KEY` and `COMPARATOR` from iterator construction with `ALLOC &ast;`&period;
| xref:bsl/multiset-05.adoc[`multiset&lt;KEY, COMPARATOR, ALLOCATOR&gt;`] 
| Deduce `KEY`, `COMPARATOR`, and `ALLOCATOR` from an initializer list&period;
| xref:bsl/multiset-060.adoc[`multiset&lt;KEY, COMPARATOR, ALLOCATOR&gt;`] 
| Deduce `KEY`, `COMPARATOR`, and `ALLOCATOR` from iterator construction&period;
| xref:bsl/multiset-00e.adoc[`multiset&lt;KEY, std::less&lt;KEY&gt;, ALLOCATOR&gt;`] 
| Deduce `KEY` and `ALLOCATOR` from an initializer&hyphen;list constructor&period;
| xref:bsl/multiset-0f.adoc[`multiset&lt;KEY, std::less&lt;KEY&gt;, ALLOCATOR&gt;`] 
| Deduce `KEY` and `ALLOCATOR` from iterator&hyphen;pair construction&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/erase_if-030.adoc[`erase&lowbar;if`]
| Erase all elements in `ms` that satisfy `predicate`&period;
| xref:bsl/operator_3way-0ff.adoc[`operator&lt;&equals;&gt;`]
| Return the lexicographic three&hyphen;way comparison of `lhs` and `rhs`&period;
| xref:bsl/operator_eq-0a8.adoc[`operator&equals;&equals;`]
| Return `true` if `lhs` and `rhs` have the same value&period;
| xref:bsl/swap-001.adoc[`swap`]
| Exchange the values of the specified `a` and `b` multisets&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
