[#bsl-unordered_map-02b-erase-0a] = xref:bsl.adoc[bsl]::xref:bsl/unordered_map-02b.adoc[unordered_map]::erase :relfileprefix: ../../ :mrdocs: Erase the element with an equivalent `key`, if present. == Synopsis Declared in `<bslstl_unorderedmap.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_KEY> xref:bsl/unordered_map-02b/size_type.adoc[size_type] erase(t_KEY&& key) requires BloombergLP::bslmf::IsTransparentPredicate<HASH, t_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,t_KEY>::value && !is_convertible<BSLS_COMPILERFEATURES_FORWARD_REF(t_KEY), iterator>::value && !is_convertible<BSLS_COMPILERFEATURES_FORWARD_REF(t_KEY), const_iterator>::value; ---- == Description Remove from this unordered map the `value_type` object having a key equivalent to the specified `key`, if it exists, and return 1; otherwise return 0 with no other effect. This overload participates in overload resolution only when the hasher and comparator are transparent. This method invalidates only iterators and references to the removed element and previously saved values of the `end()` iterator, and preserves the relative order of the elements not removed. == Return Value `1` if erased, otherwise `0` == Parameters [cols="1,4"] |=== | Name| Description | *key* | key to look up |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#