SPH
|
Expected-like class that does not contain any value. More...
#include <Outcome.h>
Public Member Functions | |
INLINE | BasicOutcome (SuccessTag) |
Constructs object with success (no error) More... | |
INLINE | BasicOutcome (FailTag) |
Constructs object with defautl error message. More... | |
INLINE | BasicOutcome (const bool value) |
Constructs object from boolean result. More... | |
template<typename T , typename = std::enable_if_t<std::is_constructible<TError, T>::value>> | |
INLINE | BasicOutcome (T &&error) |
Constructs object given error message. More... | |
INLINE bool | success () const |
Checks whether the object contains success, i.e. no error is stored. More... | |
INLINE | operator bool () const |
Conversion to bool, returning true if no error is stored. More... | |
INLINE bool | operator! () const |
Inversion operator. More... | |
INLINE const TError & | error () const |
Returns the error message. More... | |
bool | operator== (const BasicOutcome &other) const |
Compares two outcomes. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const BasicOutcome &outcome) |
Prints "success" or error message into the output stream. More... | |
BasicOutcome | operator|| (const BasicOutcome &o1, const BasicOutcome &o2) |
Logical 'or' operator, returning SUCCESS if either of the values is a SUCCESS. More... | |
BasicOutcome | operator&& (const BasicOutcome &o1, const BasicOutcome &o2) |
Logical 'and' operator, returning SUCCESS if both values are SUCCESS. More... | |
Expected-like class that does not contain any value.
Either contains "success" (no error), or error message. The error message must be default-constructible.
|
inline |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |