[#BloombergLP-bslstl-Optional_Base-05-value_or-07]
= 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 the contained value, or a converted fallback if disengaged&period;

== Synopses

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

Return the contained value, or a converted fallback if disengaged&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
t&lowbar;TYPE
xref:BloombergLP/bslstl/Optional_Base-05/value_or-09.adoc[value&lowbar;or](t&lowbar;ANY&lowbar;TYPE&& value) &amp;&amp;;
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/value_or-09.adoc[_» more&period;&period;&period;_]#

Return the contained value, or a converted fallback if disengaged&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
t&lowbar;TYPE
xref:BloombergLP/bslstl/Optional_Base-05/value_or-04a.adoc[value&lowbar;or](t&lowbar;ANY&lowbar;TYPE&& value) const &amp;;
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/value_or-04a.adoc[_» more&period;&period;&period;_]#

Return the contained value, or a converted fallback if disengaged&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
t&lowbar;TYPE
xref:BloombergLP/bslstl/Optional_Base-05/value_or-0a.adoc[value&lowbar;or](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    t&lowbar;ANY&lowbar;TYPE&& value) &amp;&amp;;
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/value_or-0a.adoc[_» more&period;&period;&period;_]#

Return the contained value, or a converted fallback if disengaged&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
t&lowbar;TYPE
xref:BloombergLP/bslstl/Optional_Base-05/value_or-041.adoc[value&lowbar;or](
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Optional_Base-05/allocator_type.adoc[allocator&lowbar;type] allocator,
    t&lowbar;ANY&lowbar;TYPE&& value) const &amp;;
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/value_or-041.adoc[_» more&period;&period;&period;_]#

== Return Value

contained value if engaged, otherwise `value` converted to `t&lowbar;TYPE`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *value*
| value compared with or used to initialize the optional
| *allocatorArg*
| tag selecting the allocator&hyphen;extended constructor
| *allocator*
| allocator used to supply memory
|===


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