[#BloombergLP-bdlc-FlatHashSet-insert-08]
= 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 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; The supplied `const&lowbar;iterator` is ignored&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:BloombergLP/bdlc/FlatHashSet/iterator.adoc[iterator]
insert(
    xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const&lowbar;iterator],
    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]#Created with https://www.mrdocs.com[MrDocs]#
