[#BloombergLP-bdlc-FlatHashMap-erase-0b] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashMap.adoc[FlatHashMap]::erase :relfileprefix: ../../../ :mrdocs: Erase the element equivalent to the specified `key`, if present. == Synopsis Declared in `<bdlc_flathashmap.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class LOOKUP_KEY> std::size_t erase(LOOKUP_KEY&& key) requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value; ---- == Description 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. == Return Value 1 if an element was erased, and 0 otherwise == Parameters [cols="1,4"] |=== | Name| Description | *key* | transparent key of the element to erase |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#