nlohmann::basic_json::erase

remove elements given an iterator range

Synopsis

Declared in <nlohmann/json.hpp>

template<class IteratorType>
requires std::is_same<IteratorType, typename basic_json_t::iterator>::value ||
                   std::is_same<IteratorType, typename basic_json_t::const_iterator>::value
IteratorType
erase(
    IteratorType first,
    IteratorType last);

Return Value

iterator following the last removed element

Parameters

NameDescription
firstiterator to the first element to remove
lastiterator following the last element to remove