erase overloads

Synopses

Declared in <nlohmann/ordered_map.hpp>

removes the element at the given position

removes the element with the given key, if it exists

size_type
erase(key_type const& key);

removes the element with the given key, if it exists

template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
size_type
erase(KeyType&& key);

removes the elements in the range [first, last)]

iterator
erase(
    iterator first,
    iterator last);

Return Value

  • iterator following the removed element

  • number of elements removed (0 or 1)

  • iterator following the last removed element

Parameters

Name

Description

pos [in]

iterator to the element to remove

key [in]

key of the element to remove

first [in]

iterator to the first element to remove

last [in]

iterator past the last element to remove

Created with MrDocs