61 return mResult.template is<T>();
68 explicit operator bool()
const {
79 static const T empty{};
105 static const Error empty_error(
"No error - result contains success value");
result(T &&value)
Construct a successful result (move)
const fl::Variant< T, Error > & variant() const
Access the underlying variant (for advanced usage)
const Error & error() const
Get the error value.
const T & value() const
Get the success value (const)
result(Error &&error)
Construct an error result (move)
result(const Error &error)
Construct an error result.
bool ok() const
Check if the result is successful.
result(const T &value)
Construct a successful result.
T & value()
Get the success value (mutable)
fl::Variant< T, Error > mResult
fl::string error_message() const
Get the error message as a convenience.
Result type for promise operations.
Implements the FastLED namespace macros.
constexpr remove_reference< T >::type && move(T &&t) noexcept
result< T > PromiseResult
Type alias for backwards compatibility.
result< T > make_success(const T &value)
Helper function to create a successful result.
result< T > make_error(const Error &error)
Helper function to create an error result.
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) noexcept
Promise-based fluent API for FastLED - standalone async primitives.