Specialization of Result for void — operations that produce no value on success.
More...
#include <error.h>
|
| bool | isOk () const noexcept |
| | Returns true if this Result represents success.
|
| bool | isError () const noexcept |
| | Returns true if this Result represents failure.
|
| ErrorCode | errorCode () const noexcept |
| | Returns the error code (Ok if successful).
|
| const void & | value () const & |
| | Returns a const reference to the success value.
|
| void | valueOr (void defaultValue) const & |
| | Returns the value if ok, or the provided default value if error.
|
Specialization of Result for void — operations that produce no value on success.
Definition at line 185 of file error.h.
◆ Result()
◆ error()
Constructs a failed void Result with the given error code.
Definition at line 195 of file error.h.
◆ errorCode()
Returns the error code (Ok if successful).
Definition at line 214 of file error.h.
◆ isError()
Returns true if this Result represents failure.
Definition at line 208 of file error.h.
◆ isOk()
Returns true if this Result represents success.
Definition at line 202 of file error.h.
◆ ok()
◆ value()
Returns a const reference to the success value.
- Precondition
- isOk() must be true. Undefined behavior otherwise.
Definition at line 133 of file error.h.
◆ valueOr()
Returns the value if ok, or the provided default value if error.
Definition at line 164 of file error.h.
◆ code_
◆ storage_
The documentation for this class was generated from the following file: