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

`make&lowbar;optional` overloads

== Synopses

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

Return an `optional` object containing a value&hyphen;initialized `t&lowbar;TYPE` object&period;


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

[.small]#xref:bsl/make_optional-01.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;TYPE&gt;
constexpr
xref:bsl/optional-072.adoc[bsl::optional&lt;bsl::decay&lt;t&lowbar;TYPE&gt;::type&gt;]
xref:bsl/make_optional-0a.adoc[make&lowbar;optional](t&lowbar;TYPE&& rhs);
----

[.small]#xref:bsl/make_optional-0a.adoc[_» more&period;&period;&period;_]#

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


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

[.small]#xref:bsl/make_optional-03.adoc[_» more&period;&period;&period;_]#

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


[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;]
xref:bsl/make_optional-00.adoc[make&lowbar;optional](
    t&lowbar;ARG&& arg,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/make_optional-00.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;TYPE&gt;
xref:bsl/optional-072.adoc[bsl::optional&lt;bsl::decay&lt;t&lowbar;TYPE&gt;::type&gt;]
xref:bsl/make_optional-04.adoc[make&lowbar;optional](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    bsl::optional&lt;bsl::decay&lt;t&lowbar;TYPE&gt;::type&gt;::allocator&lowbar;type const& alloc,
    t&lowbar;TYPE&& rhs);
----

[.small]#xref:bsl/make_optional-04.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/optional-072.adoc[bsl::optional&lt;t&lowbar;TYPE&gt;]
xref:bsl/make_optional-0e.adoc[make&lowbar;optional](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    bsl::optional&lt;t&lowbar;TYPE&gt;::allocator&lowbar;type const& alloc,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/make_optional-0e.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    class t&lowbar;INIT&lowbar;LIST&lowbar;TYPE,
    class&period;&period;&period; t&lowbar;ARGS&gt;
xref:bsl/optional-072.adoc[bsl::optional&lt;t&lowbar;TYPE&gt;]
xref:bsl/make_optional-06.adoc[make&lowbar;optional](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    bsl::optional&lt;t&lowbar;TYPE&gt;::allocator&lowbar;type const& alloc,
    std::initializer&lowbar;list&lt;t&lowbar;INIT&lowbar;LIST&lowbar;TYPE&gt; il,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:bsl/make_optional-06.adoc[_» more&period;&period;&period;_]#

== Return Value

* `optional` containing a value&hyphen;initialized `t&lowbar;TYPE`
* `optional` containing a `t&lowbar;TYPE` constructed from `rhs`
* `optional` containing a `t&lowbar;TYPE` constructed from `il` and `args`
* `optional` containing a `t&lowbar;TYPE` constructed from the arguments
* `optional` containing a `t&lowbar;TYPE` constructed from `args`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rhs*
| right&hyphen;hand operand
| *il*
| initializer list forwarded to construct the contained value
| *args*
| arguments forwarded to construct the contained value
| *arg*
| argument forwarded to construct the contained value
| *allocatorArg*
| tag selecting the allocator&hyphen;extended constructor
| *alloc*
| allocator used to supply memory for the optional
|===


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