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

`erase` overloads

== Synopses

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

Remove the element at the specified `position`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/set-0d/iterator.adoc[set&lt;KEY, COMPARATOR, ALLOCATOR&gt;::iterator]
xref:bsl/set-0d/erase-0b.adoc[erase](xref:bsl/set-0d/const_iterator.adoc[const&lowbar;iterator] position);
----

[.small]#xref:bsl/set-0d/erase-0b.adoc[_» more&period;&period;&period;_]#

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


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

[.small]#xref:bsl/set-0d/erase-0d.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using a transparent `key`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;KEY&gt;
xref:bsl/set-0d/size_type.adoc[size&lowbar;type]
xref:bsl/set-0d/erase-04.adoc[erase](t&lowbar;KEY&& key)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;COMPARATOR,
                                                   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/set-0d/erase-04.adoc[_» more&period;&period;&period;_]#

Remove the elements in the half&hyphen;open range `&lsqb;first &period;&period; last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/set-0d/iterator.adoc[set&lt;KEY, COMPARATOR, ALLOCATOR&gt;::iterator]
xref:bsl/set-0d/erase-0e.adoc[erase](
    xref:bsl/set-0d/const_iterator.adoc[const&lowbar;iterator] first,
    xref:bsl/set-0d/const_iterator.adoc[const&lowbar;iterator] last);
----

[.small]#xref:bsl/set-0d/erase-0e.adoc[_» more&period;&period;&period;_]#

== Return Value

* iterator to the element following the erased element
* 1 if an element was erased, otherwise 0
* `last`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *position*
| iterator to the element to remove
| *key*
| key of the element to remove
| *first*
| beginning of the range to erase (inclusive)
| *last*
| end of the range to erase (exclusive)
|===


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