Represents either an expected function return value or an error result.
T |
public | Result() | |
public | Result(ErrorId errorId_) | Use this constructor when constructing an error result. |
public | Result(T&& value_) | Constructs an expected function result. |
public | Result(const T& value_) | Constructs an expected function result. |
public Result | AndThen(const Result& second) | If the result represented by this result is an error result, returns this result. Otherwise returns the second result. |
public inline bool | Error() const | Returns true if the result represents an error result and false otherwise. |
public inline int | GetErrorId() const | Returns the contained error id. |
public String<char> | GetErrorMessage() const | Returns the error message associated with the error id. |
public void | SetErrorId(int errorId_) | Sets the contained error id. |
public inline T& | Value() | Returns the expected return value. |
public inline const T& | Value() const | Returns the expected return value. |
private int | errorId |
private T | value |
Use this constructor when constructing an error result.
The error id can be obtained by calling the AllocateError function.
Constructs an expected function result.
Constructs an expected function result.
If the result represented by this result is an error result, returns this result. Otherwise returns the second result.
Returns true if the result represents an error result and false otherwise.
An error result will have an error id that is a positive integer. A successful result will have an error id that is zero.
Returns the contained error id.
A positive error id indicates error. A zero error id indicates success.
Returns the error message associated with the error id.
The error message will contain a stack trace on debug builds.
Sets the contained error id.
Returns the expected return value.
Returns the expected return value.