[#bsl-map-0c7-erase-04b]
= xref:bsl.adoc[bsl]::xref:bsl/map-0c7.adoc[map&lt;int, pair&lt;shared&lowbar;ptr&lt;Statistics&gt;, shared&lowbar;ptr&lt;Collector&lt;OsLinux&gt;&gt;&gt;&gt;]::erase
:relfileprefix: ../../
:mrdocs:

`erase` overloads

== Synopses

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

Remove from this map 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 map&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 `position` refers to a `value&lowbar;type` object in this map&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/map-0c7/iterator.adoc[iterator]
xref:bsl/map-0c7/erase-08.adoc[erase](xref:bsl/map-0c7/const_iterator.adoc[const&lowbar;iterator] position);
----

[.small]#xref:bsl/map-0c7/erase-08.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, for a non&hyphen;const `iterator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/map-0c7/iterator.adoc[iterator]
xref:bsl/map-0c7/erase-046.adoc[erase](xref:bsl/map-0c7/iterator.adoc[iterator] position);
----

[.small]#xref:bsl/map-0c7/erase-046.adoc[_» more&period;&period;&period;_]#

Remove from this map the `value&lowbar;type` object whose key is equivalent the specified `key`, if such an entry exists, and return 1&semi; otherwise, if there is no `value&lowbar;type` object having an equivalent key, return 0 with no other effect&period; This method invalidates only iterators and references to the removed element and previously saved values of the `end()` iterator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/map-0c7/size_type.adoc[size&lowbar;type]
xref:bsl/map-0c7/erase-040.adoc[erase](xref:bsl/map-0c7/key_type.adoc[key&lowbar;type] const& key);
----

[.small]#xref:bsl/map-0c7/erase-040.adoc[_» more&period;&period;&period;_]#

Same as the preceding `erase` overload, for transparent comparators&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;KEY&gt;
xref:bsl/map-0c7/size_type.adoc[size&lowbar;type]
xref:bsl/map-0c7/erase-05.adoc[erase](t&lowbar;KEY&& key)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;COMPARATOR,
                                                   t&lowbar;KEY&gt;&colon;&colon;value &amp;&amp;
        !is&lowbar;convertible&lt;BSLS&lowbar;COMPILERFEATURES&lowbar;FORWARD&lowbar;REF(t&lowbar;KEY),
                        iterator&gt;&colon;&colon;value &amp;&amp;
        !is&lowbar;convertible&lt;BSLS&lowbar;COMPILERFEATURES&lowbar;FORWARD&lowbar;REF(t&lowbar;KEY),
                        const&lowbar;iterator&gt;&colon;&colon;value;
----

[.small]#xref:bsl/map-0c7/erase-05.adoc[_» more&period;&period;&period;_]#

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;


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

[.small]#xref:bsl/map-0c7/erase-0d.adoc[_» more&period;&period;&period;_]#


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