[#bsl-set-0d-erase-0e] = xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::erase :relfileprefix: ../../ :mrdocs: Remove the elements in the half‐open range `[first .. last)]`. == Synopsis Declared in `<bslstl_set.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/set-0d/iterator.adoc[set<KEY, COMPARATOR, ALLOCATOR>::iterator] erase( xref:bsl/set-0d/const_iterator.adoc[const_iterator] first, xref:bsl/set-0d/const_iterator.adoc[const_iterator] last); ---- == Description Return `last`. This method invalidates only iterators and references to the removed element and previously saved values of the `end()` iterator. 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. == 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]#