[#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 `<bdlc_flathashmap.h>` 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‐the‐end position if the removed element was the last element in the sequence of elements maintained by this map. This method invalidates all iterators and references to the removed element. The behavior is undefined unless `position` refers to an element in this map. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator] xref:BloombergLP/bdlc/FlatHashMap/erase-0a.adoc[erase](xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const_iterator] position); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/erase-0a.adoc[_» more..._]# Same as the preceding overload for a non‐const `iterator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[FlatHashMap<KEY, VALUE, HASH, EQUAL>::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..._]# Remove from this map the element whose key is equal to the specified `key`, if it exists, and return 1; otherwise (there is no element having `key` in this map), return 0 with no other effect. This method invalidates all iterators and references to the removed element. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::size_t xref:BloombergLP/bdlc/FlatHashMap/erase-0d.adoc[erase](KEY const& key); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/erase-0d.adoc[_» more..._]# Remove from this map the element whose key is equivalent to the specified `key`, if it exists, and return 1; otherwise (there is no element equivalent to `key` in this map), return 0 with no other effect. This method invalidates all iterators and references to the removed element. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class LOOKUP_KEY> std::size_t xref:BloombergLP/bdlc/FlatHashMap/erase-0b.adoc[erase](LOOKUP_KEY&& key) requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value; ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/erase-0b.adoc[_» more..._]# 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`. This method invalidates all iterators and references to the removed elements. 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator] xref:BloombergLP/bdlc/FlatHashMap/erase-0f.adoc[erase]( xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const_iterator] first, xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const_iterator] last); ---- [.small]#xref:BloombergLP/bdlc/FlatHashMap/erase-0f.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#