[#bsl-set-0d-erase-0d] = xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::erase :relfileprefix: ../../ :mrdocs: Remove from this set the `value_type` object that is equivalent to the specified `key`, if such an entry exists, and return 1; otherwise, if there is no `value_type` object that is 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_set.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/set-0d/size_type.adoc[set<KEY, COMPARATOR, ALLOCATOR>::size_type] erase(xref:bsl/set-0d/key_type.adoc[key_type] const& key); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#