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

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

== Synopsis

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

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

== Description

Return `last`&period; This method invalidates only iterators and references to the removed element and previously saved values of the `end()` iterator&period; The behavior is undefined unless `first` and `last` either refer to elements in this set or are the `end` iterator, and the `first` position is at or before the `last` position in the ordered sequence provided by this container&period;

== Return Value

`last`

== Parameters

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


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