Return the contained value, or default_value if this object is null.
Declared in <bdlb_nullableallocatedvalue.h>
template<class ANY_TYPE>
TYPE
value_or(ANY_TYPE const& default_value) const;
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.
contained value, or default_value if this object is null
| Name | Description |
|---|---|
| default_value | fallback value if this object is null |