[#bsl-map-0a7-erase-06]
= xref:bsl.adoc[bsl]::xref:bsl/map-0a7.adoc[map]::erase
:relfileprefix: ../../
:mrdocs:

Erase the half&hyphen;open range `&lsqb;first, last)&rsqb;` from this map&period;

== Synopsis

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

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

== Description

Remove from this map the `value&lowbar;type` objects starting at the specified `first` position up to, but including the specified `last` position, and 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 map 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*
| iterator to the first element to erase
| *last*
| iterator past the last element to erase
|===


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