[#bsl-make_optional-00]
= xref:bsl.adoc[bsl]::make&lowbar;optional
:relfileprefix: ../
:mrdocs:

Return an `optional` containing a value constructed from the arguments&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    class t&lowbar;ARG,
    class&period;&period;&period; t&lowbar;ARGS&gt;
constexpr
xref:bsl/optional-072.adoc[optional&lt;t&lowbar;TYPE&gt;]
make&lowbar;optional(
    t&lowbar;ARG&& arg,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

== Description

Return an `optional` object containing a `TYPE` object created by invoking a `bsl&colon;&colon;optional` `in&lowbar;place&lowbar;t` constructor with the specified `arg` and `args` as the constructor arguments&period; If `t&lowbar;TYPE` uses an allocator, the default allocator will be used for the `optional` object&period; This function can be called in constant expressions only if `t&lowbar;TYPE` is not allocator&hyphen;aware&period;

== Return Value

`optional` containing a `t&lowbar;TYPE` constructed from the arguments

== Parameters

[cols="1,4"]
|===
| Name| Description
| *arg*
| argument forwarded to construct the contained value
| *args*
| arguments forwarded to construct the contained value
|===


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