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

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

== Synopsis

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

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

== Description

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;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *allocatorArg*
| tag selecting the allocator&hyphen;extended constructor
| *allocator*
| allocator used to supply memory
| *inPlace*
| tag selecting in&hyphen;place construction of the contained value
| *args*
| arguments forwarded to construct the contained value
|===


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