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

Create an `optional` object whose contained value is initialized by forwarding from the specified `value`&period; Use the currently installed default allocator to supply memory&period; Note that this constructor participates in overload resolution only when `t&lowbar;TYPE` is constructible from `t&lowbar;ANY&lowbar;TYPE` and is explicit only when `t&lowbar;ANY&lowbar;TYPE` is not implicitly convertible to `t&lowbar;TYPE`&period; This constructor can be called in constant expressions only when `t&lowbar;TYPE` is not allocator&hyphen;aware&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE = t&lowbar;TYPE&gt;
constexpr
explicit
optional(t&lowbar;ANY&lowbar;TYPE&& value);
----


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