[#bsl-optional-072-2constructor-09c] = xref:bsl.adoc[bsl]::xref:bsl/optional-072.adoc[optional]::optional :relfileprefix: ../../ :mrdocs: Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original.value()`. == Synopsis Declared in `<bslstl_optional.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_ANY_TYPE> optional( std::allocator_arg_t allocatorArg, xref:bsl/optional-072.adoc[AllocType] allocator, std::optional<t_ANY_TYPE> const& original); ---- == Description Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original.value()` converted Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original.value()` converted to `t_TYPE` otherwise. Use the specified `allocator` to supply memory. Note that this constructor participates in overload resolution only when `t_TYPE` is constructible from an lvalue of `const t_ANY_TYPE`, and is implicit only when an lvalue of `const t_ANY_TYPE` is implicitly convertible to `t_TYPE`. == Parameters [cols="1,4"] |=== | Name| Description | *allocatorArg* | tag selecting the allocator‐extended constructor | *allocator* | allocator used to supply memory | *original* | source optional used to initialize this object |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#