[#bsl-unordered_set-0d2d-erase-0b]
= xref:bsl.adoc[bsl]::xref:bsl/unordered_set-0d2d.adoc[unordered&lowbar;set]::erase
:relfileprefix: ../../
:mrdocs:

Erase the element at `position`&period;

== Synopsis

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

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

== Description

Remove from this unordered set the `value&lowbar;type` object at the specified `position`, and return an iterator referring to the element immediately following the removed element, or to the past&hyphen;the&hyphen;end position if the removed element was the last element in the sequence of elements maintained by this set&period; This method invalidates only iterators and references to the removed element and previously saved values of the `end()` iterator, and preserves the relative order of the elements not removed&period; The behavior is undefined unless `position` refers to a `value&lowbar;type` object in this unordered set&period;

== Return Value

iterator following the erased element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *position*
| iterator to the element to erase
|===


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