|
| | StatusOr (T value) |
| | Constructs a StatusOr holding a value (implicit conversion).
|
| |
| | StatusOr (Status status) |
| | Constructs a StatusOr holding an error status.
|
| |
| auto | ok () const noexcept -> bool |
| | Returns true if a value is present (no error).
|
| |
| auto | status () const &-> Status |
| | Returns the error status.
|
| |
| auto | status () &&-> Status |
| | Returns the error status (move).
|
| |
| auto | value () const &-> const T & |
| | Returns a const reference to the value.
|
| |
| auto | value () &&-> T && |
| | Returns an rvalue reference to the value.
|
| |
| auto | operator* () const &-> const T & |
| | Dereferences to the stored value (const).
|
| |
| auto | operator* () &&-> T && |
| | Dereferences to the stored value (move).
|
| |
| auto | operator-> () const -> const T * |
| | Arrow operator for member access on the stored value.
|
| |
template<typename T>
class cppfig::StatusOr< T >
A value-or-error type, similar to std::expected (C++23).
Holds either a successfully computed value of type T, or a Status describing why the computation failed. Provides an interface compatible with the subset of absl::StatusOr used by cppfig.
- Template Parameters
-
| T | The value type. Must not be Status. |