

Go to the source code of this file.
Typedefs | |
| template<typename T > | |
| using | Result = Pair< T, Error > |
| Convenience alias for fallible return types. | |
Functions | |
| template<typename T > | |
| Result< T > | makeResult (T value) |
Creates a successful Result wrapping value. | |
| template<typename T > | |
| Result< T > | makeError (Error err) |
| Creates an error Result with a default-constructed value. | |
| template<typename T > | |
| const T & | value (const Result< T > &r) |
| Returns the value from a Result. | |
| template<typename T > | |
| const Error & | error (const Result< T > &r) |
| Returns the error from a Result. | |
| template<typename T > | |
| bool | isOk (const Result< T > &r) |
| Returns true if the Result is successful (Error::Ok). | |
| template<typename T > | |
| bool | isError (const Result< T > &r) |
| Returns true if the Result has an error. | |
See LICENSE file in the project root folder for license information.
Returns the error from a Result.
| T | The value type. |
| r | The Result to query. |
Returns true if the Result has an error.
| T | The value type. |
| r | The Result to query. |
Returns true if the Result is successful (Error::Ok).
| T | The value type. |
| r | The Result to query. |
Creates an error Result with a default-constructed value.
| T | The value type. |
| err | The error code. |
Creates a successful Result wrapping value.
| T | The value type. |
| value | The value to wrap. |