[#bsl-make_optional-0a]
= 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&gt;
constexpr
xref:bsl/optional-072.adoc[bsl::optional&lt;bsl::decay&lt;t&lowbar;TYPE&gt;::type&gt;]
make&lowbar;optional(t&lowbar;TYPE&& rhs);
----

== Description

Return an `optional` object containing a `t&lowbar;TYPE` object created by invoking a `bsl&colon;&colon;optional` constructor with the specified `rhs` as the constructor argument&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 `rhs`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rhs*
| right&hyphen;hand operand
|===


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