[#BloombergLP-bdlc-FlatHashMap-insert-08]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashMap.adoc[FlatHashMap]::insert
:relfileprefix: ../../../
:mrdocs:

`insert` overloads

== Synopses

Declared in `&lt;bdlc&lowbar;flathashmap&period;h&gt;`

Insert into this map an element having the value of each object in the specified `values` initializer list if a value with an equivalent key is not already contained in this map&period; This method requires that the (template parameter) type `KEY` be copy&hyphen;insertable (see &lcub;Requirements on `KEY`, `HASH`, and `EQUAL`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlc/FlatHashMap/insert-0a.adoc[insert](bsl::initializer&lowbar;list&lt;value&lowbar;type&gt; values);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/insert-0a.adoc[_» more&period;&period;&period;_]#

Insert the specified `value` into this map if the key of `value` does not already exist in this map&semi; otherwise, this method has no effect&period; Return a `pair` whose `first` member is an iterator referring to the (possibly newly inserted) modifiable element in this map whose key is equivalent to that of the element to be inserted, and whose `second` member is `true` if a new element was inserted, and `false` if an element with an equivalent key was already present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class VALUE&lowbar;TYPE&gt;
xref:bsl/pair-0b.adoc[bsl::pair&lt;iterator, bool&gt;]
xref:BloombergLP/bdlc/FlatHashMap/insert-00.adoc[insert](VALUE&lowbar;TYPE&& value)
requires bsl&colon;&colon;is&lowbar;constructible&lt;value&lowbar;type,
                                                  VALUE&lowbar;TYPE&amp;&amp;&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/insert-00.adoc[_» more&period;&period;&period;_]#

Insert into this map the value of each element in the input iterator range specified by `first` through `last` (including `first`, excluding `last`)&period; 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`&period; Note that if the key of a member of the input sequence is equivalent to the key of an earlier member, the later member will not be inserted&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
void
xref:BloombergLP/bdlc/FlatHashMap/insert-0f.adoc[insert](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/insert-0f.adoc[_» more&period;&period;&period;_]#

Insert the specified `value` into this map if the key of `value` does not already exist in this map&semi; otherwise, this method has no effect&period; Return an iterator referring to the (possibly newly inserted) modifiable element in this map whose key is equivalent to that of the element to be inserted&period; The supplied `const&lowbar;iterator` is ignored&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class VALUE&lowbar;TYPE&gt;
xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[iterator]
xref:BloombergLP/bdlc/FlatHashMap/insert-03.adoc[insert](
    xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const&lowbar;iterator],
    VALUE&lowbar;TYPE&& value)
requires bsl&colon;&colon;is&lowbar;constructible&lt;value&lowbar;type,
                                                  VALUE&lowbar;TYPE&amp;&amp;&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/insert-03.adoc[_» more&period;&period;&period;_]#


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