Engine → Core → result.h
result
Syntax
template <> class [[nodiscard]] result<void>
Constructors
| Access | Signature | Description |
| public | result() noexcept = default; | |
| public | result(
error failure) noexcept; | |
| public | result(
const result &) = default; | |
| public | result(
result &&) noexcept = default; | |
Destructors
| Access | Signature | Description |
| public | ~result() = default; | |
Variables
| Access | Name | Type | Default | Description |
| private | mError | std::optional<error> | std::nullopt | |
Functions
Public
get_error
[[nodiscard]] const error &get_error() const & noexcept;
The held error. Calling this on a success result is a fatal programmer error.
[[nodiscard]] error &&get_error() && noexcept;
has_value
[[nodiscard]] bool has_value() const noexcept;
success
[[nodiscard]] static result success() noexcept;
A successful void result. Equivalent to result<void>{}.
Operator Overloads
Public
operator bool
[[nodiscard]] explicit operator bool() const noexcept;
operator=