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.

Synopsis

Declared in <bslstl_unorderedmap.h>

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

Created with MrDocs