[#bsl-unordered_map-0bf-insert-0a] = xref:bsl.adoc[bsl]::xref:bsl/unordered_map-0bf.adoc[unordered_map<basic_string<char>, Json, TransparentHash, TransparentEqualTo>]::insert :relfileprefix: ../../ :mrdocs: `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`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/unordered_map-0bf/insert-0d.adoc[insert](std::initializer_list<value_type> values); ---- [.small]#xref:bsl/unordered_map-0bf/insert-0d.adoc[_» 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`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/pair-0b.adoc[pair<iterator, bool>] xref:bsl/unordered_map-0bf/insert-04.adoc[insert](xref:bsl/unordered_map-0bf/value_type.adoc[value_type] const& value); ---- [.small]#xref:bsl/unordered_map-0bf/insert-04.adoc[_» 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALT_VALUE_TYPE> xref:bsl/pair-0b.adoc[pair<iterator, bool>] xref:bsl/unordered_map-0bf/insert-0c.adoc[insert](ALT_VALUE_TYPE&& value) requires std::is_constructible<value_type, ALT_VALUE_TYPE&&>::value; ---- [.small]#xref:bsl/unordered_map-0bf/insert-0c.adoc[_» 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). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-0bf/iterator.adoc[iterator] xref:bsl/unordered_map-0bf/insert-00.adoc[insert]( xref:bsl/unordered_map-0bf/const_iterator.adoc[const_iterator] hint, xref:bsl/unordered_map-0bf/value_type.adoc[value_type] const& value); ---- [.small]#xref:bsl/unordered_map-0bf/insert-00.adoc[_» 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`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> void xref:bsl/unordered_map-0bf/insert-06.adoc[insert]( INPUT_ITERATOR first, INPUT_ITERATOR last); ---- [.small]#xref:bsl/unordered_map-0bf/insert-06.adoc[_» 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALT_VALUE_TYPE> xref:bsl/unordered_map-0bf/iterator.adoc[iterator] xref:bsl/unordered_map-0bf/insert-0b.adoc[insert]( xref:bsl/unordered_map-0bf/const_iterator.adoc[const_iterator] hint, ALT_VALUE_TYPE&& value) requires std::is_constructible<value_type, ALT_VALUE_TYPE&&>::value; ---- [.small]#xref:bsl/unordered_map-0bf/insert-0b.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#