[#bsl-make_optional-04] = xref:bsl.adoc[bsl]::make_optional :relfileprefix: ../ :mrdocs: Return an `optional` containing a value constructed from the arguments. == Synopsis Declared in `<bslstl_optional.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> xref:bsl/optional-072.adoc[bsl::optional<bsl::decay<t_TYPE>::type>] make_optional( std::allocator_arg_t allocatorArg, bsl::optional<bsl::decay<t_TYPE>::type>::allocator_type const& alloc, t_TYPE&& rhs); ---- == Description Return an `optional` object containing a `t_TYPE` object created by invoking a `bsl::optional` allocator‐extended `in_place_t` constructor with the specified `alloc` as the allocator argument, and specified `rhs` as the constructor argument. Note that this function will fail to compile if `t_TYPE` doesn't use allocators. == Return Value `optional` containing a `t_TYPE` constructed from `rhs` == Parameters [cols="1,4"] |=== | Name| Description | *allocatorArg* | tag selecting the allocator‐extended constructor | *alloc* | allocator used to supply memory for the optional | *rhs* | right‐hand operand |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#