[#BloombergLP-bdlb-NullableAllocatedValue-value_or]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/NullableAllocatedValue.adoc[NullableAllocatedValue]::value&lowbar;or
:relfileprefix: ../../../
:mrdocs:

Return the contained value, or `default&lowbar;value` if this object is null&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;nullableallocatedvalue&period;h&gt;`

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

== Description

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

== Return Value

contained value, or `default&lowbar;value` if this object is null

== Parameters

[cols="1,4"]
|===
| Name| Description
| *default&lowbar;value*
| fallback value if this object is null
|===


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