Status type wrapping an existing status code enum.
StatusOf is default constructible (OK) and explicitly constructible from the enum. Enumerators are accessed through the enum type or the Code alias (e.g. MyStatus::Code::kFailed).
Users typically create a type alias of StatusOf for their status code enum (e.g. using MyStatus = pw::StatusOf<MyCode::kOk>;).
| kOkCode | Enumerator that represents success (ok() == true). |
Public Member Functions | |
| constexpr | StatusOf (Code code) |
Public Member Functions inherited from pw::StatusBase< StatusOf< kOkCode >, kOkCode > | |
| constexpr bool | ok () const |
| Returns true if the status is the OK code. | |
| constexpr Code | code () const |
| Returns the underlying status code. | |
| constexpr void | Update (StatusOf< kOkCode > other) |
| constexpr void | IgnoreError () const |
| Ignores any errors, suppressing unused-result warnings. | |
| constexpr const char * | str () const |
Additional Inherited Members | |
Public Types inherited from pw::StatusBase< StatusOf< kOkCode >, kOkCode > | |
| using | Code = decltype(kOkCode) |
| The underlying status code type. | |
Protected Member Functions inherited from pw::StatusBase< StatusOf< kOkCode >, kOkCode > | |
| constexpr | StatusBase () |
Defaults to kOkCode (ok() == true). | |
| constexpr | StatusBase (Code code) |
| Explicitly construct from the underlying code. | |
| constexpr | StatusBase (const StatusBase &)=default |
| constexpr | StatusBase (StatusBase &&)=default |
| constexpr StatusBase & | operator= (const StatusBase &)=default |
| constexpr StatusBase & | operator= (StatusBase &&)=default |
Protected Attributes inherited from pw::StatusBase< StatusOf< kOkCode >, kOkCode > | |
| Code | code_ |