Daily bit(e) of C++ | std::expected
Daily bit(e) of C++ #221, The C++23 result type that can represent either a result or an error.
The std::expected is a C++23 type representing either a correct result or an unexpected error.
Semantically, std::expected works very similarly to std::optional; instead of optionally storing a value, std::expected always stores either a result or an error.