[#bsl-map-0a7-erase-0d] = xref:bsl.adoc[bsl]::xref:bsl/map-0a7.adoc[map]::erase :relfileprefix: ../../ :mrdocs: `erase` overloads == Synopses Declared in `<bslstl_map.h>` Erase the element at `position`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0a7/iterator.adoc[map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator] xref:bsl/map-0a7/erase-01.adoc[erase](xref:bsl/map-0a7/const_iterator.adoc[const_iterator] position); ---- [.small]#xref:bsl/map-0a7/erase-01.adoc[_» more..._]# Erase the element at `position`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0a7/iterator.adoc[map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator] xref:bsl/map-0a7/erase-02.adoc[erase](xref:bsl/map-0a7/iterator.adoc[iterator] position); ---- [.small]#xref:bsl/map-0a7/erase-02.adoc[_» more..._]# Erase the element whose key is equivalent to `key`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0a7/size_type.adoc[map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type] xref:bsl/map-0a7/erase-0b.adoc[erase](xref:bsl/map-0a7/key_type.adoc[key_type] const& key); ---- [.small]#xref:bsl/map-0a7/erase-0b.adoc[_» more..._]# Erase the element matching a transparent `key`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_KEY> xref:bsl/map-0a7/size_type.adoc[size_type] xref:bsl/map-0a7/erase-0f.adoc[erase](t_KEY&& key) requires BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, t_KEY>::value && !is_convertible<BSLS_COMPILERFEATURES_FORWARD_REF(t_KEY), iterator>::value && !is_convertible<BSLS_COMPILERFEATURES_FORWARD_REF(t_KEY), const_iterator>::value; ---- [.small]#xref:bsl/map-0a7/erase-0f.adoc[_» more..._]# Erase the half‐open range `[first, last)]` from this map. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0a7/iterator.adoc[map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator] xref:bsl/map-0a7/erase-06.adoc[erase]( xref:bsl/map-0a7/const_iterator.adoc[const_iterator] first, xref:bsl/map-0a7/const_iterator.adoc[const_iterator] last); ---- [.small]#xref:bsl/map-0a7/erase-06.adoc[_» more..._]# == Return Value * iterator to the element following the erased element * 1 if an element was erased, otherwise 0 * `last` == Parameters [cols="1,4"] |=== | Name| Description | *position* | iterator to the element to erase | *key* | key whose matching element is erased | *first* | iterator to the first element to erase | *last* | iterator past the last element to erase |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#