[#bsl-set-0d-emplace_hint] = xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::emplace_hint :relfileprefix: ../../ :mrdocs: Emplace a newly constructed `value_type` near `hint` if not present. == Synopsis Declared in `<bslstl_set.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class... Args> xref:bsl/set-0d/iterator.adoc[set<KEY, COMPARATOR, ALLOCATOR>::iterator] emplace_hint( xref:bsl/set-0d/const_iterator.adoc[const_iterator] hint, Args&&... arguments); ---- == Description Construct by forwarding `get_allocator()` (if required) and the specified `arguments` to the corresponding constructor of `value_type` (in amortized constant time if `hint` is a valid immediate successor); otherwise this method has no effect (other than possibly creating a temporary `value_type` object). Return an iterator referring to the (possibly newly created and inserted) object in this set whose value is equivalent to that of an object constructed from `arguments`. If `hint` is not a valid immediate successor to the `value_type` object implied by `arguments`, this operation has `O[log(N)]` complexity where `N` is the size of this set. This method requires that the (template parameter) type `KEY` be `emplace‐constructible` from `arguments` (see {Requirements on `KEY`}). The behavior is undefined unless `hint` is an iterator in the range `[begin() .. end()]` (both endpoints included). == Return Value iterator to the existing or newly inserted element == Parameters [cols="1,4"] |=== | Name| Description | *hint* | iterator hint for insertion position | *arguments* | constructor arguments for the new element |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#