value overloads

Synopses

Declared in <bdlb_nullablevalue.h>

Return a reference providing modifiable access to the underlying TYPE object. The behavior is undefined unless this object is non‐null.

TYPE&
value();

Return a reference to the contained object.

TYPE const&
value() const;

Return a reference providing modifiable access to the underlying t_TYPE object if true == has_value() and throw bsl::bad_optional_access otherwise.

t_TYPE&
value() &;

Return an rvalue reference to the contained value; throws if disengaged.

t_TYPE&&
value() &&;

Return a reference providing non‐modifiable access to the underlying t_TYPE object if true == has_value() and throw bsl::bad_optional_access otherwise.

t_TYPE const&
value() const &;

Return an rvalue reference to the underlying t_TYPE object if `true == has_value()` and throw `bsl::bad_optional_access` otherwise.

t_TYPE const&&
value() const &&;

Return Value

  • a reference providing modifiable access to the underlying TYPE object object

  • a reference providing non‐modifiable access to the underlying TYPE object

  • reference providing modifiable access to the contained value

  • rvalue reference providing modifiable access to the contained value

  • reference providing non‐modifiable access to the contained value

  • rvalue reference providing non‐modifiable access to the contained value

Created with MrDocs