Skip to content

Engine → Core

result.h

Either a value or an error. The engine's replacement for exceptions. Check with has_value() (or operator bool) before calling value().

Classes

File Description
result Either a value or an error. The engine's replacement for exceptions. Check with has_value() (or operator bool) before calling value().
result<void> A result that carries no value: success, or an error.

Type Aliases

status

using status = result<void>;

Convenience alias for operations that only report success or failure.

Functions

Public

detail::wrong_result_alternative

[[noreturn]] inline void wrong_result_alternative(const char *what);

Accessing the wrong alternative of a result is a programmer error. It asserts, and because continuing would dereference nothing, it terminates even when the assertion handler asks to continue.