[#BloombergLP-bdlb-NullableValueRef-valueOr]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/NullableValueRef.adoc[NullableValueRef]::valueOr
:relfileprefix: ../../../
:mrdocs:

Return the underlying value, or `otherValue` if null&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
TYPE
valueOr(TYPE const& otherValue) const;
----

== Description

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

== Return Value

underlying value, or `otherValue` if null

== Parameters

[cols="1,4"]
|===
| Name| Description
| *otherValue*
| fallback when this object is null
|===


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