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

Constructors

== Synopses

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

Create a disengaged `optional` object&period; Use the currently installed default allocator to supply memory&period; This constructor can be called in constant expressions only when `t&lowbar;TYPE` is not allocator&hyphen;aware&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
xref:bsl/optional-072/2constructor-0ae.adoc[optional]() noexcept;
----

[.small]#xref:bsl/optional-072/2constructor-0ae.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original&period;value()` converted to `t&lowbar;TYPE` otherwise&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 an lvalue of `const t&lowbar;ANY&lowbar;TYPE`, and is implicit only when an lvalue of `const t&lowbar;ANY&lowbar;TYPE` is implicitly convertible to `t&lowbar;TYPE`&period; This constructor can be called in constant expressions only when neither `t&lowbar;TYPE` nor `t&lowbar;ANY&lowbar;TYPE` is allocator&hyphen;aware&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
xref:bsl/optional-072/2constructor-07f.adoc[optional](xref:bsl/optional-072.adoc[optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;] const& original);
----

[.small]#xref:bsl/optional-072/2constructor-07f.adoc[_» more&period;&period;&period;_]#

Construct an `optional` in&hyphen;place from the specified arguments&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
explicit
xref:bsl/optional-072/2constructor-0cb.adoc[optional](xref:bsl/optional-072.adoc[optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;] const& original);
----

[.small]#xref:bsl/optional-072/2constructor-0cb.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object&period; Use the currently installed default allocator to supply memory&period; This constructor can be called in constant expressions only when `t&lowbar;TYPE` is not allocator&hyphen;aware&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
xref:bsl/optional-072/2constructor-0d3.adoc[optional](xref:bsl/nullopt_t.adoc[bsl::nullopt&lowbar;t]) noexcept;
----

[.small]#xref:bsl/optional-072/2constructor-0d3.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original&period;value()` moved and converted to `t&lowbar;TYPE` otherwise&period; Use the allocator from `original` to supply memory if `t&lowbar;ANY&lowbar;TYPE` is a non&hyphen;const version of `t&lowbar;TYPE`&semi; otherwise, use the currently installed default allocator&period; `original` is left in a valid but unspecified state&period; Note that this constructor participates in overload resolution only when `t&lowbar;TYPE` is constructible from an xvalue of `t&lowbar;ANY&lowbar;TYPE`, and is implicit only when an xvalue of `t&lowbar;ANY&lowbar;TYPE` is implicitly convertible to `t&lowbar;TYPE`&period; This constructor can be called in constant expressions only when neither `t&lowbar;TYPE` nor `t&lowbar;ANY&lowbar;TYPE` is allocator&hyphen;aware&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
xref:bsl/optional-072/2constructor-080.adoc[optional](xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef&lowbar;Deduced&lt;optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&gt;] original);
----

[.small]#xref:bsl/optional-072/2constructor-080.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
explicit
xref:bsl/optional-072/2constructor-004.adoc[optional](xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef&lowbar;Deduced&lt;optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&gt;] original);
----

[.small]#xref:bsl/optional-072/2constructor-004.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original&period;value()` converted to `t&lowbar;TYPE` otherwise&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 an lvalue of `const t&lowbar;ANY&lowbar;TYPE`, and is implicit only when an lvalue of `const t&lowbar;ANY&lowbar;TYPE` is 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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
xref:bsl/optional-072/2constructor-035.adoc[optional](std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt; const& original);
----

[.small]#xref:bsl/optional-072/2constructor-035.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original&period;value()` converted to `t&lowbar;TYPE` otherwise&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 an lvalue of `const t&lowbar;ANY&lowbar;TYPE`, and is explicit only when an lvalue of `const 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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
explicit
xref:bsl/optional-072/2constructor-013.adoc[optional](std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt; const& original);
----

[.small]#xref:bsl/optional-072/2constructor-013.adoc[_» more&period;&period;&period;_]#

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 implicit only when `t&lowbar;ANY&lowbar;TYPE` is 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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE = t&lowbar;TYPE&gt;
constexpr
xref:bsl/optional-072/2constructor-0af.adoc[optional](t&lowbar;ANY&lowbar;TYPE&& value);
----

[.small]#xref:bsl/optional-072/2constructor-0af.adoc[_» more&period;&period;&period;_]#

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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE = t&lowbar;TYPE&gt;
constexpr
explicit
xref:bsl/optional-072/2constructor-0c2.adoc[optional](t&lowbar;ANY&lowbar;TYPE&& value);
----

[.small]#xref:bsl/optional-072/2constructor-0c2.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original&period;value()` converted to `t&lowbar;TYPE` otherwise&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 an xvalue of `t&lowbar;ANY&lowbar;TYPE`, and is implicit only when an xvalue of `t&lowbar;ANY&lowbar;TYPE` is 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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
xref:bsl/optional-072/2constructor-05.adoc[optional](std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&& original);
----

[.small]#xref:bsl/optional-072/2constructor-05.adoc[_» more&period;&period;&period;_]#

Explicitly create an `optional` by moving from the specified `std&colon;&colon;optional` `original`&period; Use the currently installed default allocator to supply memory&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
explicit
xref:bsl/optional-072/2constructor-0f0.adoc[optional](std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&& original);
----

[.small]#xref:bsl/optional-072/2constructor-0f0.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object&period; Use the specified `allocator` to supply memory&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/optional-072/2constructor-0e.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator);
----

[.small]#xref:bsl/optional-072/2constructor-0e.adoc[_» more&period;&period;&period;_]#

Create an `optional` object having the value of the (template parameter) `t&lowbar;TYPE` created in place using the specified `args`&period; Use the currently installed default allocator to supply memory&period; This constructor can be called in constant expressions only when `t&lowbar;TYPE` is not allocator&hyphen;aware&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
constexpr
explicit
xref:bsl/optional-072/2constructor-0c8.adoc[optional](
    std::in&lowbar;place&lowbar;t,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/optional-072/2constructor-0c8.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object&period; Use the specified `allocator` to supply memory&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/optional-072/2constructor-08f.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    xref:bsl/nullopt_t.adoc[bsl::nullopt&lowbar;t]);
----

[.small]#xref:bsl/optional-072/2constructor-08f.adoc[_» more&period;&period;&period;_]#

If the specified `original` contains a value, create an `optional` object whose contained value is initialized from `&ast;original`&semi; otherwise, create a disengaged `optional` object&period; Use the specified `allocator` to supply memory&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/optional-072/2constructor-06c.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    xref:bsl/optional-072.adoc[optional] const& original);
----

[.small]#xref:bsl/optional-072/2constructor-06c.adoc[_» more&period;&period;&period;_]#

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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;DERIVED&gt;
xref:bsl/optional-072/2constructor-097.adoc[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]#xref:bsl/optional-072/2constructor-097.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original&period;value()` moved and converted to `t&lowbar;TYPE` otherwise&period; Use the specified `allocator` to supply memory&period; `original` is left in a valid but unspecified state&period; Note that this constructor participates in overload resolution only when `t&lowbar;TYPE` is constructible from an xvalue of `t&lowbar;ANY&lowbar;TYPE`, and is implicit only when an xvalue of `t&lowbar;ANY&lowbar;TYPE` is implicitly convertible to `t&lowbar;TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:bsl/optional-072/2constructor-00e.adoc[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;optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&gt;] original);
----

[.small]#xref:bsl/optional-072/2constructor-00e.adoc[_» more&period;&period;&period;_]#

Explicitly create an `optional` by moving from the specified `original` using the specified `allocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
explicit
xref:bsl/optional-072/2constructor-07d.adoc[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;optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&gt;] original);
----

[.small]#xref:bsl/optional-072/2constructor-07d.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original&period;value()` converted to `t&lowbar;TYPE` otherwise&period; Use the specified `allocator` to supply memory&period; Note that this constructor participates in overload resolution only when `t&lowbar;TYPE` is constructible from an lvalue of `const t&lowbar;ANY&lowbar;TYPE`, and is implicit only when an lvalue of `const t&lowbar;ANY&lowbar;TYPE` is implicitly convertible to `t&lowbar;TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:bsl/optional-072/2constructor-087.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    xref:bsl/optional-072.adoc[optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;] const& original);
----

[.small]#xref:bsl/optional-072/2constructor-087.adoc[_» more&period;&period;&period;_]#

Explicitly create an `optional` from the specified `original` using the specified `allocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
explicit
xref:bsl/optional-072/2constructor-09e.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    xref:bsl/optional-072.adoc[optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;] const& original);
----

[.small]#xref:bsl/optional-072/2constructor-09e.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original&period;value()` converted to `t&lowbar;TYPE` otherwise&period; Use the specified `allocator` to supply memory&period; Note that this constructor participates in overload resolution only when `t&lowbar;TYPE` is constructible from an lvalue of `const t&lowbar;ANY&lowbar;TYPE`, and is implicit only when an lvalue of `const t&lowbar;ANY&lowbar;TYPE` is implicitly convertible to `t&lowbar;TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:bsl/optional-072/2constructor-09c.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt; const& original);
----

[.small]#xref:bsl/optional-072/2constructor-09c.adoc[_» more&period;&period;&period;_]#

Explicitly create an `optional` from the specified `std&colon;&colon;optional` `original` using the specified `allocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
explicit
xref:bsl/optional-072/2constructor-0d1.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt; const& original);
----

[.small]#xref:bsl/optional-072/2constructor-0d1.adoc[_» more&period;&period;&period;_]#

Create an `optional` object whose contained value is initialized by forwarding from the specified `value`&period; Use the specified `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 implicit only when `t&lowbar;ANY&lowbar;TYPE` is implicitly convertible to `t&lowbar;TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE = t&lowbar;TYPE&gt;
xref:bsl/optional-072/2constructor-0fb.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    t&lowbar;ANY&lowbar;TYPE&& value);
----

[.small]#xref:bsl/optional-072/2constructor-0fb.adoc[_» more&period;&period;&period;_]#

Create an `optional` object whose contained value is initialized by forwarding from the specified `value`&period; Use the specified `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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE = t&lowbar;TYPE&gt;
explicit
xref:bsl/optional-072/2constructor-03e.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    t&lowbar;ANY&lowbar;TYPE&& value);
----

[.small]#xref:bsl/optional-072/2constructor-03e.adoc[_» more&period;&period;&period;_]#

Create a disengaged `optional` object if the specified `original` object is disengaged, and an `optional` object with the value of `original&period;value()` moved and converted to `t&lowbar;TYPE` otherwise&period; Use the specified `allocator` to supply memory&period; `original` is left in a valid but unspecified state&period; Note that this constructor participates in overload resolution only when `t&lowbar;TYPE` is constructible from an xvalue of `t&lowbar;ANY&lowbar;TYPE`, and is implicit only when an xvalue of `t&lowbar;ANY&lowbar;TYPE` is implicitly convertible to `t&lowbar;TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
xref:bsl/optional-072/2constructor-04f.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&& original);
----

[.small]#xref:bsl/optional-072/2constructor-04f.adoc[_» more&period;&period;&period;_]#

Explicitly create an `optional` by moving from the specified `std&colon;&colon;optional` `original` using the specified `allocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
explicit
xref:bsl/optional-072/2constructor-01f.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&& original);
----

[.small]#xref:bsl/optional-072/2constructor-01f.adoc[_» more&period;&period;&period;_]#

Create an `optional` object having the value of the (template parameter) `t&lowbar;TYPE` created in place using the specified `il` and specified `args`&period; Use the currently installed default allocator to supply memory&period; This constructor can be called in constant expressions only when `t&lowbar;TYPE` is not allocator&hyphen;aware&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;INIT&lowbar;LIST&lowbar;TYPE,
    class&period;&period;&period; t&lowbar;ARGS&gt;
constexpr
explicit
xref:bsl/optional-072/2constructor-0a8.adoc[optional](
    std::in&lowbar;place&lowbar;t,
    std::initializer&lowbar;list&lt;t&lowbar;INIT&lowbar;LIST&lowbar;TYPE&gt; il,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/optional-072/2constructor-0a8.adoc[_» more&period;&period;&period;_]#

Create an `optional` object having the value of the (template parameter) `t&lowbar;TYPE` created in place using the specified `args`&period; Use the specified `allocator` to supply memory&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
explicit
xref:bsl/optional-072/2constructor-064.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    std::in&lowbar;place&lowbar;t,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/optional-072/2constructor-064.adoc[_» more&period;&period;&period;_]#

Create an `optional` object having the value of the (template parameter) `t&lowbar;TYPE` created in place using the specified `il` and `args`&period; Use the specified `allocator` to supply memory&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;INIT&lowbar;LIST&lowbar;TYPE,
    class&period;&period;&period; t&lowbar;ARGS&gt;
explicit
xref:bsl/optional-072/2constructor-086.adoc[optional](
    std::allocator&lowbar;arg&lowbar;t,
    xref:bsl/optional-072.adoc[AllocType] allocator,
    std::in&lowbar;place&lowbar;t,
    std::initializer&lowbar;list&lt;t&lowbar;INIT&lowbar;LIST&lowbar;TYPE&gt; il,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/optional-072/2constructor-086.adoc[_» more&period;&period;&period;_]#


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