bsl::unordered_map<basic_string<char>, Json, TransparentHash, TransparentEqualTo>::insert

insert overloads

Synopses

Declared in <bslstl_unorderedmap.h>

Create a value_type object for each element in the specified values. Insert into this unordered map each such object whose key is not already contained. Note that this method requires that the (template parameter) types KEY and VALUE both be copy-constructible (see {Requirements on value_type}).

void
insert(std::initializer_list<value_type> values);
» more...

Insert the specified value into this unordered map if the key (the first element) of the object referred to by value does not already exist in this unordered map; otherwise, this method has no effect (a value_type object having the key equivalent to the key of value already exists in this unordered map). Return a pair whose first member is an iterator referring to the (possibly newly inserted) value_type object in this unordered map whose key is equivalent to that of the object to be inserted, and whose second member is true if a new value was inserted, and false if a value having an equivalent key was already present. Note that this method requires that the (template parameter) types KEY and VALUE both be copy-insertable into this unordered map (see {Requirements on value_type}).

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

Insert the specified value into this unordered map if the key (the first element) of the object referred to by value does not already exist in this unordered map; otherwise, this method has no effect (a value_type object having the same key as the converted value already exists in this unordered map) . Return a pair whose first member is an iterator referring to the (possibly newly inserted) value_type object in this unordered map whose key is the equivalent to that of the object to be inserted, and whose second member is true if a new value was inserted, and false if a value having an equivalent key was already present. Note that this method requires that the (template parameter) types KEY and VALUE both be move-constructible (see {Requirements on value_type}), and that the value_type be constructible from the (template parameter) ALT_VALUE_TYPE. Also note that this one template stands in for three insert functions in the C++11 standard.

template<class ALT_VALUE_TYPE>
pair<iterator, bool>
insert(ALT_VALUE_TYPE&& value)
requires std::is_constructible<value_type,
                                             ALT_VALUE_TYPE&&>::value;
» more...

Insert the specified value into this unordered map if the key (the first element) of the object referred to by value does not already exist in this unordered map; otherwise, this method has no effect (a value_type object having the key equivalent to the key of value already exists in this unordered map). Return an iterator referring to ether the newly inserted value_type object or to the existing object whose key is equivalent to the key of value. The average and worst case complexity of this operation is not affected by the specified hint. This method requires that the (template parameter) types KEY and VALUE both be copy-insertable into this unordered map (see {Requirements on value_type}). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included). Note that hint is ignored (other than possibly asserting its validity in some build modes).

iterator
insert(
    const_iterator hint,
    value_type const& value);
» more...

Create a value_type object for each iterator in the range starting at the specified first iterator and ending immediately before the specified last iterator, by converting from the object referred to by each iterator. Insert into this unordered map each such object whose key is not already contained. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3]providing access to values of a type convertible to value_type. The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last. Note that this method requires that the (template parameter) types KEY and VALUE both be copy-constructible (see {Requirements on value_type}).

template<class INPUT_ITERATOR>
void
insert(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last);
» more...

Insert the specified value into this unordered map if the key (the first element) of the object referred to by value does not already exist in this unordered map; otherwise, this method has no effect (a value_type object having the same key as the converted value already exists in this unordered map) . Return an iterator referring to ether the newly inserted) value_type object or to the existing object whose key is equivalent to the key of value. The average and worst case complexity of this operation is not affected by the specified hint. This method requires that the (template parameter) types KEY and VALUE both be move-constructible (see {Requirements on value_type}) and that the value_type be constructible from the (template parameter) ALT_VALUE_TYPE. The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included). Note that hint is ignored (other than possibly asserting its validity in some build modes). Also note that this one template stands in for three insert functions in the C++11 standard.

template<class ALT_VALUE_TYPE>
iterator
insert(
    const_iterator hint,
    ALT_VALUE_TYPE&& value)
requires std::is_constructible<value_type,
                                             ALT_VALUE_TYPE&&>::value;
» more...