[#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 the `value` does not already exist in this set&semi; otherwise, this method has no effect&period; Return a `pair` whose `first` member is a `const&lowbar;iterator` referring to the (possibly newly inserted) element in this set whose value 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 equivalent value was 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 into this set an element having the value of each object in the specified `values` initializer list if an equivalent value is not already contained in this set&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/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 the `value` does not already exist in this set&semi; otherwise, this method has no effect&period; Return a `pair` whose `first` member is a `const&lowbar;iterator` referring to the (possibly newly inserted) element in this set whose value 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 equivalent value was 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 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;


[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` into this set if the `value` does not already exist in this set&semi; otherwise, this method has no effect&period; Return a `const&lowbar;iterator` referring to the (possibly newly inserted) element in this set whose value 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"]
----
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],
    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` into this set if the `value` does not already exist in this set&semi; otherwise, this method has no effect&period; Return a `const&lowbar;iterator` referring to the (possibly newly inserted) element in this set whose value 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"]
----
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],
    KEY const& value);
----

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

Insert into this set 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 a member of the input sequence is equivalent to 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/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` 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;


[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],
    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;_]#


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