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

`make&lowbar;optional` overloads

== Synopses

Declared in `&lt;absl&sol;types&sol;optional&period;h&gt;`

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename T&gt;
constexpr
decltype(std&colon;&colon;make&lowbar;optional(
    std&colon;&colon;declval&lt;T&gt;()))
xref:absl/make_optional-06.adoc[make&lowbar;optional](T&& value);
----

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

Creates an `optional&lt;T&gt;` by constructing `T` in place&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename&period;&period;&period; Args&gt;
constexpr
decltype(std&colon;&colon;make&lowbar;optional&lt;T&gt;(
    std&colon;&colon;declval&lt;Args&gt;()&period;&period;&period;))
xref:absl/make_optional-02.adoc[make&lowbar;optional](Args&&&period;&period;&period; args);
----

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

Creates an `optional&lt;T&gt;` from an initializer list and extra arguments&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U,
    typename&period;&period;&period; Args&gt;
constexpr
decltype(std&colon;&colon;make&lowbar;optional&lt;T&gt;(
    std&colon;&colon;declval&lt;std&colon;&colon;initializer&lowbar;list&lt;U&gt;&gt;(),
    std&colon;&colon;declval&lt;Args&gt;()&period;&period;&period;))
xref:absl/make_optional-07.adoc[make&lowbar;optional](
    std::initializer&lowbar;list&lt;U&gt; il,
    Args&&&period;&period;&period; args);
----

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

== Return Value

* An optional holding the forwarded value&period;
* An optional holding the constructed value&period;

== Parameters

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


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