[#bsl-set-0d-erase-0d]
= xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::erase
:relfileprefix: ../../
:mrdocs:

Remove the element equivalent to the specified `key`, if present&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/set-0d/size_type.adoc[set&lt;KEY, COMPARATOR, ALLOCATOR&gt;::size&lowbar;type]
erase(xref:bsl/set-0d/key_type.adoc[key&lowbar;type] const& key);
----

== Description

Return 1 if an entry was removed&semi; otherwise 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&period;

== Return Value

1 if an element was erased, otherwise 0

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key of the element to remove
|===


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