Flutter Engine
The Flutter Engine
|
#include <status_or.h>
Public Member Functions | |
StatusOr (const T &value) | |
StatusOr (T &&value) | |
StatusOr (const Status &status) | |
StatusOr (const StatusOr &)=default | |
StatusOr (StatusOr &&)=default | |
StatusOr & | operator= (const StatusOr &)=default |
StatusOr & | operator= (StatusOr &&)=default |
StatusOr & | operator= (const T &value) |
StatusOr & | operator= (const T &&value) |
StatusOr & | operator= (const Status &value) |
const Status & | status () const |
bool | ok () const |
const T & | value () const |
T & | value () |
Represents a union type of an object of type T
and an fml::Status.
This is often used as a replacement for C++ exceptions where a function that could fail may return an error or a result. These are typically used for errors that are meant to be recovered from. If there is no recovery available FML_CHECK
is more appropriate.
Example: StatusOr<int> div(int n, int d) { if (d == 0) { return Status(StatusCode::kFailedPrecondition, "div by zero"); } return n / d; }
Definition at line 32 of file status_or.h.
|
inline |
Definition at line 36 of file status_or.h.
|
inline |
Definition at line 40 of file status_or.h.
|
inline |
Definition at line 44 of file status_or.h.
|
default |
|
default |
|
inline |
Definition at line 75 of file status_or.h.
|
inline |
Definition at line 67 of file status_or.h.
|
inline |
Definition at line 61 of file status_or.h.
|
inline |
Definition at line 55 of file status_or.h.
|
inline |
Definition at line 73 of file status_or.h.
|
inline |
Definition at line 86 of file status_or.h.
|
inline |
Definition at line 77 of file status_or.h.