[#nlohmann-ordered_map-insert-0e]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/ordered_map.adoc[ordered&lowbar;map]::insert
:relfileprefix: ../../
:mrdocs:

`insert` overloads

== Synopses

Declared in `&lt;nlohmann&sol;ordered&lowbar;map&period;hpp&gt;`

inserts an element if the key does not already exist


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::pair&lt;iterator, bool&gt;
xref:nlohmann/ordered_map/insert-0d.adoc[insert](xref:nlohmann/ordered_map/value_type.adoc[value&lowbar;type] const& value);
----

[.small]#xref:nlohmann/ordered_map/insert-0d.adoc[_» more&period;&period;&period;_]#

inserts an element if the key does not already exist


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::pair&lt;iterator, bool&gt;
xref:nlohmann/ordered_map/insert-05.adoc[insert](xref:nlohmann/ordered_map/value_type.adoc[value&lowbar;type]&& value);
----

[.small]#xref:nlohmann/ordered_map/insert-05.adoc[_» more&period;&period;&period;_]#

inserts the elements in the range &lsqb;first, last), skipping keys that already exist&rsqb;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename InputIt,
    typename = xref:nlohmann/ordered_map/require_input_iter.adoc[require&lowbar;input&lowbar;iter&lt;InputIt&gt;]&gt;
void
xref:nlohmann/ordered_map/insert-09.adoc[insert](
    InputIt first,
    InputIt last);
----

[.small]#xref:nlohmann/ordered_map/insert-09.adoc[_» more&period;&period;&period;_]#

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *value* [in]
| key&hyphen;value pair to insert
| *first* [in]
| iterator to the first element to insert
| *last* [in]
| iterator past the last element to insert
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
