[#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;`

Remove from this map the element at the specified `position`, and return an iterator referring to the modifiable 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 all iterators and references to the removed element&period; The behavior is undefined unless `position` refers to an element in this map&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;_]#

Same as the preceding overload for a non&hyphen;const `iterator`&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;_]#

Remove from this map the element whose key is equal to the specified `key`, if it exists, and return 1&semi; otherwise (there is no element having `key` in this map), return 0 with no other effect&period; This method invalidates all iterators and references to the removed element&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;_]#

Remove from this map the element whose key is equivalent to the specified `key`, if it exists, and return 1&semi; otherwise (there is no element equivalent to `key` in this map), return 0 with no other effect&period; This method invalidates all iterators and references to the removed element&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;_]#

Remove from this map the elements starting at the specified `first` position up to, but not including, the specified `last` position, and return an iterator referencing the same element as `last`&period; This method invalidates all iterators and references to the removed elements&period; The behavior is undefined unless `first` and `last` are valid iterators on this map, and the `first` position is at or before the `last` position in the iteration sequence provided by this container&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;_]#


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