[#bsl-set-0d-insert-0e] = xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::insert :relfileprefix: ../../ :mrdocs: Insert a transparent `value` near `hint` if not already present. == Synopsis Declared in `<bslstl_set.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class LOOKUP_KEY> xref:bsl/set-0d/iterator.adoc[iterator] insert( xref:bsl/set-0d/const_iterator.adoc[const_iterator] hint, LOOKUP_KEY&& value) requires BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value && !bsl::is_convertible<LOOKUP_KEY&&, iterator>::value && !bsl::is_convertible<LOOKUP_KEY&&, const_iterator>::value; ---- == Description `value` is left in a valid but unspecified state. Return an iterator referring to the (possibly newly inserted) `value_type` object in this set that is equivalent to `value`. The average and worst case complexity of this operation is not affected by the specified `hint`. This method requires that the (template parameter) type `KEY` be `move‐insertable` (see {Requirements on `KEY`}) into this set. The behavior is undefined unless `hint` is an iterator in the range `[begin() .. end()]` (both endpoints included). Note that `hint` is ignored (other than possibly asserting its validity in some build modes). Note: implemented inline due to Sun CC compilation error. == Return Value iterator to the existing or newly inserted element == Parameters [cols="1,4"] |=== | Name| Description | *hint* | iterator hint for insertion position | *value* | key to insert |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#