bsl::multimap::erase

Erase all elements whose keys are equivalent to key.

Synopsis

Declared in <bslstl_multimap.h>

multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
erase(key_type const& key);

Description

Remove from this multimap all value_type objects whose keys are equivalent to the specified key, if such entries exist, and return the number of erased objects; otherwise, if there is no value_type objects having an equivalent key, 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

number of elements erased

Parameters

NameDescription
keykey whose matching elements are erased