|
FlatImage
A configurable Linux containerization system
|
Enhanced expected type with integrated logging capabilities. More...
#include <expected.hpp>
Public Member Functions | |
| template<ns_string::static_string fmt = "Q::", typename... Args> | |
| void | discard_impl (ns_log::Location const &loc, Args &&... args) |
| Log error and discard it if present. | |
| template<ns_string::static_string fmt = "Q::", typename... Args> | |
| Value< T, E > | forward_impl (ns_log::Location const &loc, Args &&... args) |
| Forward error with logging or return value. | |
| T | or_default () |
Enhanced expected type with integrated logging capabilities.
Value extends std::expected to provide automatic error logging and convenient error handling methods. It maintains full compatibility with std::expected while adding FlatImage-specific functionality.
| T | The expected value type (can be void) |
| E | The error type (defaults to std::string) |
Definition at line 43 of file expected.hpp.
|
inline |
Log error and discard it if present.
If this Value contains an error, logs it at the specified level along with any additional context, then continues execution.
| fmt | Format string with log level prefix (D::, I::, W::, E::, C::) |
| Args | Types of additional format arguments |
| loc | Source location for logging |
| args | Additional arguments for the format string |
Definition at line 87 of file expected.hpp.
|
inline |
Forward error with logging or return value.
If this Value contains an error, logs it and returns a new Value with the same error. Otherwise, returns a Value with the contained value.
| fmt | Format string with log level prefix |
| Args | Types of additional format arguments |
| loc | Source location for logging |
| args | Additional arguments for the format string |
Definition at line 111 of file expected.hpp.
|
inline |
Definition at line 134 of file expected.hpp.