Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. pw_status
  5. pw::StatusOf< kOkCode > Class Template Reference
Loading...
Searching...
No Matches
pw::StatusOf< kOkCode > Class Template Referencefinal

Overview

template<auto kOkCode>
class pw::StatusOf< kOkCode >

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>;).

Template Parameters
kOkCodeEnumerator that represents success (ok() == true).
Inheritance diagram for pw::StatusOf< kOkCode >:
pw::StatusBase< StatusOf< kOkCode >, kOkCode >

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_
 

The documentation for this class was generated from the following file: