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.