![]() |
General Utility Library for C++17 25.4.1
|
An expected<T, E>
is an object that normally contains an "expected" object of type T, but it can alternatively contain another, "unexpected" or "error" object of type E.
The main use case of expected
is as a function return value. It is a more expressive alternative to the common idiom of returning a bool
to indicate success or failure, and using an output parameter to return the result: