Erase the element matching a transparent key.

Synopsis

Declared in <bslstl_map.h>

template<class t_KEY>
size_type
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;

Description

Remove from this map the value_type object whose key compares equivalent to the specified transparent key, if such an entry exists, and return 1; otherwise return 0 with no other effect. This method invalidates only iterators and references to the removed element and previously saved values of the end() iterator.

Return Value

1 if an element was erased, otherwise 0

Parameters

Name

Description

key

key whose matching element is erased

Created with MrDocs