[#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;`

Remove from this unordered multiset the `value&lowbar;type` object at the specified `position`, and return an iterator referring to the element immediately following the removed element, or to the past&hyphen;the&hyphen;end position if the removed element was the last element in the sequence of elements maintained by this unordered multiset&period; This method invalidates only iterators and references to the removed element and previously saved values of the `end()` iterator, and preserves the relative order of the elements not removed&period; The behavior is undefined unless `position` refers to a `value&lowbar;type` object in this unordered multiset&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;_]#

Remove from this unordered multiset all `value&lowbar;type` objects that are equivalent to the specified `key`, if they exist, and return the number of object erased&semi; otherwise, if there are no `value&lowbar;type` objects equivalent to `key`, return 0 with no other effect&period; This method invalidates only iterators and references to the removed element and previously saved values of the `end()` iterator, and preserves the relative order of the elements not removed&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;_]#

Remove from unordered multiset the `value&lowbar;type` objects starting at the specified `first` position up to, but not including the specified `last` position, and return `last`&period; This method invalidates only iterators and references to the removed element and previously saved values of the `end()` iterator, and preserves the relative order of the elements not removed&period; The behavior is undefined unless `first` and `last` either refer to elements in this unordered multiset or are the `end` iterator, and the `first` position is at or before the `last` position in the sequence provided by this container&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;_]#


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