[#bsl-optional-072-2constructor-097]
= xref:bsl.adoc[bsl]::xref:bsl/optional-072.adoc[optional]::optional
:relfileprefix: ../../
:mrdocs:

If the `optional` base class of the specified `original` holds a value, create an `optional` object whose contained value is initialized by moving from that value&semi; otherwise, create a disengaged `optional` object&period; Use the specified `allocator` to supply memory&period; `original` is left in a valid, but unspecified state&period; Note that this constructor does not participate in overload resolution unless `optional` is an accessible base class of `t&lowbar;DERIVED` or `t&lowbar;DERIVED` is `optional` itself (in which case the instantiation provides the allocator&hyphen;extended move constructor)&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;optional&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;DERIVED&gt;
optional(
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef&lowbar;Deduced&lt;t&lowbar;DERIVED&gt;] original);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
