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

Erase the element matching a transparent `key`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;KEY&gt;
xref:bsl/map-0a7/size_type.adoc[size&lowbar;type]
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;
----

== Description

Remove from this map the `value&lowbar;type` object whose key compares equivalent to the specified transparent `key`, if such an entry exists, and return 1&semi; otherwise 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;

== Return Value

1 if an element was erased, otherwise 0

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key whose matching element is erased
|===


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