valueOr overloads

Synopses

Declared in <bdlb_nullablevalue.h>

Return the contained value, or value if this object is null.

TYPE
valueOr(TYPE const& value) const;

Return the address of the contained value, or value if null.

TYPE const*
valueOr(TYPE const* value) const;

Return Value

  • the contained value if non‐null, and the specified value otherwise

  • address of the underlying object if non‐null, and value otherwise

Parameters

Name

Description

value

fallback value returned when this object is null

Created with MrDocs