|
FastLED 3.9.15
|
expected type for operations that can fail (C++23-style)
Explicit error handling without exceptions, using fl::variant for safe storage
| T | The type of the successful value |
| E | The type of the error code (must be an enum or integral type) |
Definition at line 79 of file expected.h.
#include <expected.h>
Inheritance diagram for fl::expected< T, E >:Public Member Functions | |
| expected () FL_NOEXCEPT | |
| Default constructor (creates error state) | |
| expected (expected &&other) FL_NOEXCEPT=default | |
| Move constructor (defaulted - variant handles it) | |
| ~expected () FL_NOEXCEPT=default | |
| Destructor (defaulted - variant handles cleanup) | |
| E | error () const FL_NOEXCEPT |
| Get error code (only meaningful if !ok()) | |
| bool | has_value () const FL_NOEXCEPT |
| Check if operation succeeded (alias for ok()) | |
| const char * | message () const FL_NOEXCEPT |
| Get error message (only meaningful if !ok()) | |
| bool | ok () const FL_NOEXCEPT |
| Check if operation succeeded. | |
| operator bool () const FL_NOEXCEPT | |
| Explicit conversion to bool for contextual evaluation. | |
| expected & | operator= (expected &&other) FL_NOEXCEPT=default |
| Move assignment (defaulted - variant handles it) | |
| const T & | value () const FL_NOEXCEPT |
| T & | value () FL_NOEXCEPT |
| Get value (only valid if ok() == true) | |
Static Public Member Functions | |
| static expected | failure (E err, const char *msg=nullptr) FL_NOEXCEPT |
| Create error result. | |
| static expected | success (T value) FL_NOEXCEPT |
| Create successful result. | |
Private Member Functions | |
| expected (const expected &) FL_NOEXCEPT=delete | |
| expected & | operator= (const expected &) FL_NOEXCEPT=delete |
Private Attributes | |
| fl::variant< T, ErrorInfo< E > > | mData |