[#bsl-unordered_multiset-06c-erase-03]
= xref:bsl.adoc[bsl]::xref:bsl/unordered_multiset-06c.adoc[unordered&lowbar;multiset]::erase
:relfileprefix: ../../
:mrdocs:

`erase` overloads

== Synopses

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

Erase the element at `position` and return the following iterator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/iterator.adoc[unordered&lowbar;multiset&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;::iterator]
xref:bsl/unordered_multiset-06c/erase-0c.adoc[erase](xref:bsl/unordered_multiset-06c/const_iterator.adoc[const&lowbar;iterator] position);
----

[.small]#xref:bsl/unordered_multiset-06c/erase-0c.adoc[_» more&period;&period;&period;_]#

Erase all elements equivalent to `key` and return the count erased&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/size_type.adoc[unordered&lowbar;multiset&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;::size&lowbar;type]
xref:bsl/unordered_multiset-06c/erase-0f.adoc[erase](xref:bsl/unordered_multiset-06c/key_type.adoc[key&lowbar;type] const& key);
----

[.small]#xref:bsl/unordered_multiset-06c/erase-0f.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using a transparent key type&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;KEY&gt;
xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type]
xref:bsl/unordered_multiset-06c/erase-01.adoc[erase](t&lowbar;KEY&& key)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASH, t&lowbar;KEY&gt;&colon;&colon;value &amp;&amp;
        BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;EQUAL,t&lowbar;KEY&gt;&colon;&colon;value &amp;&amp;
        !is&lowbar;convertible&lt;BSLS&lowbar;COMPILERFEATURES&lowbar;FORWARD&lowbar;REF(t&lowbar;KEY),
                        iterator&gt;&colon;&colon;value &amp;&amp;
        !is&lowbar;convertible&lt;BSLS&lowbar;COMPILERFEATURES&lowbar;FORWARD&lowbar;REF(t&lowbar;KEY),
                        const&lowbar;iterator&gt;&colon;&colon;value;
----

[.small]#xref:bsl/unordered_multiset-06c/erase-01.adoc[_» more&period;&period;&period;_]#

Erase the half&hyphen;open range `&lsqb;first, last)&rsqb;` and return `last`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/iterator.adoc[unordered&lowbar;multiset&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;::iterator]
xref:bsl/unordered_multiset-06c/erase-02.adoc[erase](
    xref:bsl/unordered_multiset-06c/const_iterator.adoc[const&lowbar;iterator] first,
    xref:bsl/unordered_multiset-06c/const_iterator.adoc[const&lowbar;iterator] last);
----

[.small]#xref:bsl/unordered_multiset-06c/erase-02.adoc[_» more&period;&period;&period;_]#

== Return Value

* iterator following the erased element
* number of elements erased
* `last`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *position*
| iterator to the element to erase
| *key*
| key value of elements to erase
| *first*
| beginning of the erase range
| *last*
| end of the erase range (one past last)
|===


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