template<typename ValueType, typename ErrorType>
class Result< ValueType, ErrorType >
A class that represents a result that can either be a value or an error.
This class is used in error handling scenarios instead of exceptions. Whenever a function may return an error it will return a Result object that can be checked for the error and handled accordingly.
The advantage of this approach is that it makes errors more explicit than exceptions by specifying them in the return value and forcing them to handle them.
Using this class is also made easier by the TRY and MUST macros.
- Template Parameters
-
ValueType | The type of the value that the Result object may contain. |
ErrorType | The type of the error that the Result object may contain. |