bsl::unordered_multimap::erase

erase overloads

Synopses

Declared in <bslstl_unorderedmultimap.h>

Remove from this unordered multimap the value_type object at the specified position, and return an iterator referring to the element immediately following the removed element, or to the past-the-end position if the removed element was the last element in the sequence of elements maintained by this unordered multimap. 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. The behavior is undefined unless position refers to a value_type object in this unordered multimap.

unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
erase(const_iterator position);
» more...

Same as the related overload above for erase.

unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
erase(iterator position);
» more...

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.

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

Same as the preceding erase overload for transparent key types.

template<class t_KEY>
size_type
erase(t_KEY&& key)
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, t_KEY>::value &&
        BloombergLP::bslmf::IsTransparentPredicate<EQUAL,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...

Remove from this unordered multimap the value_type objects starting at the specified first position up to, but not including, the specified last position, and return last. 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. The behavior is undefined unless first and last either refer to elements in this unordered multimap or are the end iterator, and the first position is at or before the last position in the sequence provided by this container.

unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
erase(
    const_iterator first,
    const_iterator last);
» more...