[#BloombergLP-bslstl-Optional_Base-05-value_or-04a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional&lowbar;Base]::value&lowbar;or
:relfileprefix: ../../../
:mrdocs:

Return a copy of the underlying object of a (template parameter) `t&lowbar;TYPE` if this object is non&hyphen;null, and the specified `value` converted to `t&lowbar;TYPE` otherwise&period; Note that this method returns _by_ _value_, so may be inefficient in some contexts&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
t&lowbar;TYPE
value&lowbar;or(t&lowbar;ANY&lowbar;TYPE&& value) const &amp;;
----


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