[#bsl-multiset-03-erase-05] = xref:bsl.adoc[bsl]::xref:bsl/multiset-03.adoc[multiset]::erase :relfileprefix: ../../ :mrdocs: Remove from this multiset all `value_type` objects equivalent to the specified `key`, if they exist, and return the number of erased objects; 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. == Synopsis Declared in `<bslstl_multiset.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/multiset-03/size_type.adoc[multiset<KEY, COMPARATOR, ALLOCATOR>::size_type] erase(xref:bsl/multiset-03/key_type.adoc[key_type] const& key); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#