template<auto kOkCode,
StatusMessages kMessages = StatusMessages::kDefault>
class pw::StatusOf< kOkCode, kMessages >
Status type wrapping an existing status code enum.
StatusOf is default constructible (OK), explicitly constructible from the enum, and constructible from (Code, Message) using PW_STATUS_MSG("..."). 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>;).
- Template Parameters
-
|
|
constexpr | StatusOf (Code code) noexcept |
| |
|
constexpr | StatusOf (Code code, Message message) noexcept |
| |
|
constexpr bool | ok () const noexcept |
| | Returns true if the status is the OK code.
|
| |
|
constexpr Code | code () const noexcept |
| | Returns the underlying status code.
|
| |
| constexpr bool | has_message () const noexcept |
| |
| constexpr Message | message () const noexcept |
| |
| constexpr void | Update (Derived other) noexcept |
| |
|
constexpr void | IgnoreError () const noexcept |
| | Ignores any errors, suppressing unused-result warnings.
|
| |
| constexpr const char * | str () const |
| |