|
|
| Result (const T &t) noexcept(std::is_nothrow_copy_constructible< T >::value) |
| |
|
| Result (T &&t) noexcept(std::is_nothrow_move_constructible< T >::value) |
| |
|
| Result (const E &e) noexcept(std::is_nothrow_copy_constructible< E >::value) |
| |
|
| Result (E &&e) noexcept(std::is_nothrow_move_constructible< E >::value) |
| |
|
| Result (const Result &other) noexcept(std::is_nothrow_copy_assignable< T >::value &&std::is_nothrow_copy_assignable< E >::value) |
| |
|
| Result (Result &&other) noexcept(std::is_nothrow_move_assignable< T >::value &&std::is_nothrow_move_assignable< E >::value) |
| |
|
Result & | operator= (Result const &other) noexcept(std::is_nothrow_copy_assignable< T >::value &&std::is_nothrow_copy_assignable< E >::value) |
| |
|
Result & | operator= (Result &&other) noexcept(std::is_nothrow_move_assignable< T >::value &&std::is_nothrow_move_assignable< E >::value) |
| |
| template<typename... Args> |
| void | EmplaceValue (Args &&...args) |
| | Construct a new value from the give argument(s) and assign it to the instance value. More...
|
| |
| template<typename... Args> |
| void | EmplaceError (Args &&...args) |
| | Construct a new error from the give argument(s) and assign it to the instance error. More...
|
| |
| void | Swap (Result &other) noexcept(std::is_nothrow_move_assignable< T >::value &&std::is_nothrow_move_assignable< E >::value) |
| | Swap the current instance with another one. More...
|
| |
| bool | HasValue () const noexcept |
| | Indicate whether the instance has a value or not. More...
|
| |
| | operator bool () const noexcept |
| |
| const T & | operator* () const & |
| |
| T && | operator* () && |
| |
| const T * | operator-> () const |
| |
| const T & | Value () const & |
| | Get instance possible value. More...
|
| |
| T && | Value () && |
| | Get instance possible value. More...
|
| |
| const E & | Error () const & |
| | Get instance possible error. More...
|
| |
| E && | Error () && |
| | Get instance possible error. More...
|
| |
| Optional< T > | Ok () const & |
| | Get optional instance value. More...
|
| |
| Optional< T > | Ok () && |
| | Get optional instance value. More...
|
| |
| Optional< E > | Err () const & |
| | Get optional instance error. More...
|
| |
| Optional< E > | Err () && |
| | Get optional instance error. More...
|
| |
| template<typename U > |
| T | ValueOr (U &&defaultValue) const & |
| | Get the instance value or the default value. More...
|
| |
| template<typename U > |
| T | ValueOr (U &&defaultValue) && |
| | Get the instance value or the default value. More...
|
| |
| template<typename G > |
| E | ErrorOr (G &&defaultError) const & |
| | Get the instance error or the default error. More...
|
| |
| template<typename G > |
| E | ErrorOr (G &&defaultError) && |
| | Get the instance error or the default error. More...
|
| |
| template<typename G > |
| bool | CheckError (G &&error) const |
| | Check an error with the instance error. More...
|
| |
| const T & | ValueOrThrow () const &noexcept(false) |
| | Get instance possible value or throw an exception. More...
|
| |
| T && | ValueOrThrow () &&noexcept(false) |
| | Get instance possible value or throw an exception. More...
|
| |
| template<typename F > |
| T | Resolve (F &&f) const |
| | Get the instance value or a callable result. More...
|
| |
| template<typename F > |
| auto | Bind (F &&f) const -> Result< decltype(f(Value())), E > |
| | Create a new Result by passing the instance value (if exists) to a callable. More...
|
| |
template<typename T, typename E = ErrorCode>
class ara::core::Result< T, E >
A wrapper around the callee's return value and its possible error.
- Template Parameters
-
| T | Callee's return value type |
| E | Callee's possible error type |