This class is a wrapper for either a bsl::optional or NullableAllocatedValue, and provides modifiable access to the wrapped object.

Synopsis

Declared in <bdlb_nullablevalueref.h>

template<class TYPE>
class NullableValueRef;

Type Aliases

Name

Description

value_type

value_type is an alias for the template parameter TYPE, and represents the type of the object managed by the wrapped nullable object.

Member Functions

Name

Description

NullableValueRef [constructor]

Constructors

operator=

Assignment operators

addressOr

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

emplace

Emplace a value constructed from args into the target.

has_value

Return true if the target contains a value, and false otherwise.

isNull

Return whether the target does not contain a value.

makeValueInplace

Construct a value in place from args and return it.

operator*

Dereference operators

operator‐>

Member access operators

reset

Reset the target to the default constructed state (i.e., to have the null value).

value

value overloads

valueOr

Return the underlying value, or otherValue if null.

valueOrNull

Return an address providing non‐modifiable access to the underlying object of a (template parameter) TYPE if this object is non‐null, and 0 otherwise.

value_or

Return the underlying value, or default_value if null.

operator bool

Return true if the target holds a value, and false otherwise.

Friends

Name

Description

BloombergLP::bdlb::ConstNullableValueRef

This class is a wrapper for either a bsl::optional or NullableAllocatedValue, and provides non‐modifiable access to the wrapped object.

Non-Member Functions

Name

Description

operator!=

See the overload above for contract.

operator!=

Return whether lhs and rhs do not have the same value.

operator!=

Return whether the nullable reference is not null.

operator!=

Return whether lhs and rhs do not have the same value.

operator<

Return false; nullopt never orders after a nullable reference.

operator<

Return whether lhs is ordered before rhs.

operator<

Return whether lhs is ordered before rhs.

operator<

See the overload above for contract.

operator<=

Return whether lhs is ordered before rhs or they are equal.

operator<=

See the overload above for contract.

operator<=

Return whether lhs is ordered before rhs or they are equal.

operator<=

Return whether lhs is null.

operator==

Return whether lhs is null.

operator==

See the overload above for contract.

operator==

Return whether lhs and rhs have the same value.

operator==

Return whether lhs and rhs have the same value.

operator>

See the overload above for contract.

operator>

Return whether lhs is ordered after rhs.

operator>

Return whether lhs is ordered after rhs.

operator>

Return whether lhs is not null.

operator>=

Return whether lhs is ordered after rhs or they are equal.

operator>=

See the overload above for contract.

operator>=

Return whether lhs is ordered after rhs or they are equal.

operator>=

Return true.

Created with MrDocs