absl::optional_ref::value

Returns a reference to the underlying value.

Synopsis

Declared in <absl/types/optional_ref.h>

constexpr
T&
value() const;

Description

Throws the same error as std::optional::value() when empty.

Return Value

A reference to the referenced value.