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

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

== Synopsis

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

[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;]
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;
----

== Description

Insert the specified `key` into this set if a key equivalent to `k` does not already exist in this set&semi; otherwise, this method has no effect&period; Return a pair containing an `iterator` referring to the newly inserted element and `true` if a element was inserted&period; Return a pair containing an `iterator` to an existing element and `false` if the value already existed in the set&period;

== Return Value

pair of iterator to the element and whether insertion occurred

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key to insert
|===


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