[#bsl-unordered_multiset-06c-erase-0f] = xref:bsl.adoc[bsl]::xref:bsl/unordered_multiset-06c.adoc[unordered_multiset]::erase :relfileprefix: ../../ :mrdocs: Erase all elements equivalent to `key` and return the count erased. == Synopsis Declared in `<bslstl_unorderedmultiset.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_multiset-06c/size_type.adoc[unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>::size_type] erase(xref:bsl/unordered_multiset-06c/key_type.adoc[key_type] const& key); ---- == Description Remove from this unordered multiset all `value_type` objects that are equivalent to the specified `key`, if they exist, and return the number of object erased; otherwise, if there are no `value_type` objects equivalent to `key`, return 0 with no other effect. 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. == Return Value number of elements erased == Parameters [cols="1,4"] |=== | Name| Description | *key* | key value of elements to erase |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#