[#BloombergLP-bdlb-NullableAllocatedValue-value_or] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/NullableAllocatedValue.adoc[NullableAllocatedValue]::value_or :relfileprefix: ../../../ :mrdocs: Return the contained value, or `default_value` if this object is null. == Synopsis Declared in `<bdlb_nullableallocatedvalue.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ANY_TYPE> TYPE value_or(ANY_TYPE const& default_value) const; ---- == Description Return the value of the underlying object of a (template parameter) `TYPE` if this object is non‐null, and the specified `default_value` otherwise. Note that this method returns _by_ _value_, so may be inefficient in some contexts. == Return Value contained value, or `default_value` if this object is null == Parameters [cols="1,4"] |=== | Name| Description | *default_value* | fallback value if this object is null |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#