pw_status: Introduce StatusBase and rework Status StatusBase is a zero-cost CRTP status base class used to define Status-like objects with custom status codes. A designated code value represents success (ok()). This enables richer, domain-specific status semantics while preserving standard Pigweed error handling conventions, including PW_TRY, PW_CHECK_OK, and PW_ASSERT_OK. Custom status types can be defined using the PW_STATUS_TYPE macro or by subclassing StatusBase directly with CRTP. Custom status types are constructed from their Code. pw::Status is reworked to be a concrete final class that inherits from StatusBase<Status, PW_STATUS_OK>, retaining all canonical helper methods and implicit pw_Status interop. PW_TRY and PW_CHECK_OK continue to accept types implicitly convertible to pw::Status. Change-Id: I33acb7f507f7e7290f0eae45edbc53eff007abb1 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/477645
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.