[#bsl-optional-072-2constructor-086] = xref:bsl.adoc[bsl]::xref:bsl/optional-072.adoc[optional]::optional :relfileprefix: ../../ :mrdocs: Assign a new value to this optional. == Synopsis Declared in `<bslstl_optional.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_INIT_LIST_TYPE, class... t_ARGS> explicit optional( std::allocator_arg_t allocatorArg, xref:bsl/optional-072.adoc[AllocType] allocator, std::in_place_t inPlace, std::initializer_list<t_INIT_LIST_TYPE> il, t_ARGS&&... args); ---- == Description Create an `optional` object having the value of the (template parameter) `t_TYPE` created in place using the specified `il` and `args`. Use the specified `allocator` to supply memory. == Parameters [cols="1,4"] |=== | Name| Description | *allocatorArg* | tag selecting the allocator‐extended constructor | *allocator* | allocator used to supply memory | *inPlace* | tag selecting in‐place construction of the contained value | *il* | initializer list forwarded to construct the contained value | *args* | arguments forwarded to construct the contained value |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#