FastLED 3.9.15
Loading...
Searching...
No Matches
result.h File Reference

Detailed Description

result<T, E> type alias for fl::expected (Rust-style naming)

This file provides a Rust-style naming alias for the C++23-style expected type. The underlying implementation is in fl/stl/expected.h.

Example usage:

result<int> divide(int a, int b) {
if (b == 0) {
return result<int>::failure(ResultError::INVALID_ARGUMENT, "Division by zero");
}
return result<int>::success(a / b);
}
auto r = divide(10, 2);
if (r.ok()) {
int value = r.value();
}

Definition in file result.h.

#include "fl/stl/expected.h"
+ Include dependency graph for result.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  fl
 Base definition for an LED controller.
 

Typedefs

template<typename T, typename E = ResultError>
using fl::result = expected<T, E>
 Alias for expected (Rust-style naming)