bsl::unordered_multimap::erase

Erase all elements with key equivalent to key and return the count.

Synopsis

Declared in <bslstl_unorderedmultimap.h>

unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
erase(key_type const& key);

Description

Remove from this unordered multimap all value_type objects with a key equivalent to the specified key, if such exist, and return the number of objects erased; otherwise, if there are no value_type objects with a key equivalent to 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, and preserves the relative order of the elements not removed.

Return Value

number of elements erased

Parameters

NameDescription
keykey value of elements to erase