[#BloombergLP-bdlc-FlatHashMap-erase-04b]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashMap.adoc[FlatHashMap]::erase
:relfileprefix: ../../../
:mrdocs:

`erase` overloads

== Synopses

Declared in `&lt;bdlc&lowbar;flathashmap&period;h&gt;`

Erase the element at the specified `position`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[FlatHashMap&lt;KEY, VALUE, HASH, EQUAL&gt;::iterator]
xref:BloombergLP/bdlc/FlatHashMap/erase-0a.adoc[erase](xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const&lowbar;iterator] position);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/erase-0a.adoc[_» more&period;&period;&period;_]#

Erase the element at the specified `position`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[FlatHashMap&lt;KEY, VALUE, HASH, EQUAL&gt;::iterator]
xref:BloombergLP/bdlc/FlatHashMap/erase-040.adoc[erase](xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[iterator] position);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/erase-040.adoc[_» more&period;&period;&period;_]#

Erase the element with the specified `key`, if present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
xref:BloombergLP/bdlc/FlatHashMap/erase-0d.adoc[erase](KEY const& key);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/erase-0d.adoc[_» more&period;&period;&period;_]#

Erase the element equivalent to the specified `key`, if present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class LOOKUP&lowbar;KEY&gt;
std::size&lowbar;t
xref:BloombergLP/bdlc/FlatHashMap/erase-0b.adoc[erase](LOOKUP&lowbar;KEY&& key)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASH, LOOKUP&lowbar;KEY&gt;&colon;&colon;value
         &amp;&amp; BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;EQUAL,LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/erase-0b.adoc[_» more&period;&period;&period;_]#

Erase the elements in the half&hyphen;open range `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[FlatHashMap&lt;KEY, VALUE, HASH, EQUAL&gt;::iterator]
xref:BloombergLP/bdlc/FlatHashMap/erase-0f.adoc[erase](
    xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const&lowbar;iterator] first,
    xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const&lowbar;iterator] last);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/erase-0f.adoc[_» more&period;&period;&period;_]#

== Return Value

* iterator following the erased element
* 1 if an element was erased, and 0 otherwise
* iterator equal to `last`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *position*
| iterator to the element to erase
| *key*
| key of the element to erase
| *first*
| beginning of the erase range
| *last*
| end of the erase range (exclusive)
|===


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