[#bsl-set-0d-insert-06e]
= xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::insert
:relfileprefix: ../../
:mrdocs:

Insert `value` if an equivalent key is not already present&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;set&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[pair&lt;set&lt;KEY, COMPARATOR, ALLOCATOR&gt;::iterator, bool&gt;]
insert(xref:bsl/set-0d/value_type.adoc[value&lowbar;type] const& value);
----

== Description

Return a pair whose `first` member is an iterator referring to the (possibly newly inserted) `value&lowbar;type` object in this set that is equivalent to `value`, and whose `second` member is `true` if a new value was inserted, and `false` if the key was already present&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;insertable` into this set (see &lcub;Requirements on `KEY`&rcub;)&period;

== Return Value

pair of iterator and whether a new element was inserted

== Parameters

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


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