bsl::map::erase

erase overloads

Synopses

Declared in <bslstl_map.h>

Erase the element at position.

map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
erase(const_iterator position);
» more...

Erase the element at position.

map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
erase(iterator position);
» more...

Erase the element whose key is equivalent to key.

map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
erase(key_type const& key);
» more...

Erase the element matching a transparent key.

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;
» more...

Erase the half-open range [first, last)] from this map.

map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
erase(
    const_iterator first,
    const_iterator last);
» more...

Return Value

  • iterator to the element following the erased element
  • 1 if an element was erased, otherwise 0
  • last

Parameters

NameDescription
positioniterator to the element to erase
keykey whose matching element is erased
firstiterator to the first element to erase
lastiterator past the last element to erase