[#bsl-set-0d-erase-0b] = xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::erase :relfileprefix: ../../ :mrdocs: Remove the element at the specified `position`. == 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] position); ---- == Description Return an iterator referring to the element immediately following the removed element, or to the past‐the‐end position if the removed element was the last element in the sequence of elements maintained by this set. This method invalidates only iterators and references to the removed element and previously saved values of the `end()` iterator. The behavior is undefined unless `position` refers to a `value_type` object in this set. == Return Value iterator to the element following the erased element == Parameters [cols="1,4"] |=== | Name| Description | *position* | iterator to the element to remove |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#