nlohmann::ordered_map::insert

insert overloads

Synopses

Declared in <nlohmann/ordered_map.hpp>

inserts an element if the key does not already exist

std::pair<iterator, bool>
insert(value_type const& value);
» more...

inserts an element if the key does not already exist

std::pair<iterator, bool>
insert(value_type&& value);
» more...

inserts the elements in the range [first, last), skipping keys that already exist]

template<
    typename InputIt,
    typename = require_input_iter<InputIt>>
void
insert(
    InputIt first,
    InputIt last);
» more...

Return Value

pair of an iterator to the (possibly pre-existing) element and a bool that is true if the insertion took place

Parameters

NameDescription
value [in]key-value pair to insert
first [in]iterator to the first element to insert
last [in]iterator past the last element to insert