[#BloombergLP-bdlc-FlatHashSet-insert-0c]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashSet.adoc[FlatHashSet]::insert
:relfileprefix: ../../../
:mrdocs:

`insert` overloads

== Synopses

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

Insert the specified `value` into this set if not already present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[bsl::pair&lt;const&lowbar;iterator, bool&gt;]
xref:BloombergLP/bdlc/FlatHashSet/insert-0ee.adoc[insert](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;KEY&gt;] value);
----

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

Insert each element from the specified initializer list&period;


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

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

Insert the specified `value` into this set if not already present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[bsl::pair&lt;const&lowbar;iterator, bool&gt;]
xref:BloombergLP/bdlc/FlatHashSet/insert-068.adoc[insert](KEY const& value);
----

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

Insert the specified `key` into this set if not already present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class LOOKUP&lowbar;KEY&gt;
xref:bsl/pair-0b.adoc[bsl::pair&lt;iterator, bool&gt;]
xref:BloombergLP/bdlc/FlatHashSet/insert-0e3.adoc[insert](LOOKUP&lowbar;KEY&& key)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASH, LOOKUP&lowbar;KEY&gt;&colon;&colon;value
         &amp;&amp; BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;EQUAL,LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

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

Insert the specified `value`, ignoring the insertion hint&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const&lowbar;iterator]
xref:BloombergLP/bdlc/FlatHashSet/insert-06a.adoc[insert](
    xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;KEY&gt;] value);
----

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

Insert the specified `value`, ignoring the insertion hint&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const&lowbar;iterator]
xref:BloombergLP/bdlc/FlatHashSet/insert-02.adoc[insert](
    xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const&lowbar;iterator] hint,
    KEY const& value);
----

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

Insert each element from the specified iterator range&period;


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

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

Insert the specified `key`, ignoring the insertion hint&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class LOOKUP&lowbar;KEY&gt;
xref:BloombergLP/bdlc/FlatHashSet/iterator.adoc[iterator]
xref:BloombergLP/bdlc/FlatHashSet/insert-08.adoc[insert](
    xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const&lowbar;iterator] hint,
    LOOKUP&lowbar;KEY&& key)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASH, LOOKUP&lowbar;KEY&gt;&colon;&colon;value
         &amp;&amp; BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;EQUAL,LOOKUP&lowbar;KEY&gt;&colon;&colon;value
         &amp;&amp; bsl&colon;&colon;is&lowbar;convertible&lt;LOOKUP&lowbar;KEY&amp;&amp;, const&lowbar;iterator&gt;&colon;&colon;value &equals;&equals; false
         &amp;&amp; bsl&colon;&colon;is&lowbar;convertible&lt;const&lowbar;iterator, LOOKUP&lowbar;KEY&amp;&amp;&gt;&colon;&colon;value &equals;&equals; false;
----

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

== Return Value

* pair of iterator to the element and whether insertion occurred
* iterator to the existing or newly inserted element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *value*
| element to insert
| *values*
| initializer list of elements to insert
| *key*
| key to insert
| *hint*
| ignored hint iterator
| *first*
| beginning of the input range
| *last*
| end of the input range (exclusive)
|===


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