Insert value if its key is not already present.
Synopsis
Declared in <bslstl_unorderedmap.h>
pair<iterator, bool>
insert(value_type const& value);
Description
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}).
Return Value
iterator to the element and whether insertion occurred
Parameters
Name |
Description |
value |
value to insert |
Created with MrDocs