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

`make&lowbar;optional` overloads

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Creates an optional holding a decayed copy of the given value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    int = 0,
    class T&gt;
constexpr
xref:beman/optional/optional-03.adoc[optional&lt;std::decay&lowbar;t&lt;T&gt;&gt;]
xref:beman/optional/make_optional-05.adoc[make&lowbar;optional](T&& t) noexcept(&sol;&ast; see-below &ast;&sol;)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;std&colon;&colon;decay&lowbar;t&lt;T&gt;, T&gt;;
----

[.small]#xref:beman/optional/make_optional-05.adoc[_» more&period;&period;&period;_]#

Creates an optional&lt;T&gt; constructing the value in&hyphen;place from the given arguments&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename&period;&period;&period; Args&gt;
constexpr
xref:beman/optional/optional-03.adoc[optional&lt;T&gt;]
xref:beman/optional/make_optional-00.adoc[make&lowbar;optional](Args&&&period;&period;&period; args) noexcept(&sol;&ast; see-below &ast;&sol;)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, Args&period;&period;&period;&gt;;
----

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

Creates an optional&lt;T&gt; constructing the value in&hyphen;place from an initializer list and arguments&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U,
    typename&period;&period;&period; Args&gt;
constexpr
xref:beman/optional/optional-03.adoc[optional&lt;T&gt;]
xref:beman/optional/make_optional-0f.adoc[make&lowbar;optional](
    std::initializer&lowbar;list&lt;U&gt; il,
    Args&&&period;&period;&period; args) noexcept(&sol;&ast; see-below &ast;&sol;)
requires std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T, std&colon;&colon;initializer&lowbar;list&lt;U&gt;&amp;, Args&period;&period;&period;&gt;;
----

[.small]#xref:beman/optional/make_optional-0f.adoc[_» more&period;&period;&period;_]#

== Return Value

* An engaged optional whose contained value is constructed from `t&period;`
* An engaged optional&lt;T&gt; holding the in&hyphen;place constructed value&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *t*
| The value to store in the returned optional&period;
| *args*
| The arguments forwarded to the constructor of `T&period;`
| *il*
| The initializer list forwarded to the constructor of `T&period;`
|===


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