BloombergLP::bdlb::NullableValueRef::valueOr

Return the underlying value, or otherValue if null.

Synopsis

Declared in <bdlb_nullablevalueref.h>

TYPE
valueOr(TYPE const& otherValue) const;

Description

Return the value of the underlying object of a (template parameter) TYPE if this object is non-null, and the specified otherValue otherwise. Note that this method returns by value, so may be inefficient in some contexts.

Return Value

underlying value, or otherValue if null

Parameters

NameDescription
otherValuefallback when this object is null