|
Infinity Engine v0.6.20
C++ API Documentation
|
Classes | |
| class | RuntimeUtils |
| Utility for detecting available scripting runtime bridges. More... | |
| class | StringUtils |
| Utility functions for string manipulation and parsing. More... | |
Typedefs | |
| template<class T , class E > | |
| using | Expected = tl::expected< T, E > |
| Type-safe error handling using the expected/unexpected pattern. | |
| template<class E > | |
| using | Unexpected = tl::unexpected< E > |
| Represents an error value for Expected<T, E>. | |
Functions | |
| template<class E > | |
| auto | make_unexpected (E &&e) -> Unexpected< typename std::decay< E >::type > |
| Constructs an Unexpected error value. | |
| Infinity::Util::Expected |
Type-safe error handling using the expected/unexpected pattern.
Expected<T, E> represents a value that may either contain a successful result of type T or an error of type E. This provides a type-safe alternative to exceptions for error handling, making error paths explicit in the type system.
This is a thin wrapper around tl::expected, providing the standard expected/unexpected pattern for the Infinity Engine. It enables:
Common patterns:
| T | Type of the successful value. |
| E | Type of the error value. |
Example usage:
| Infinity::Util::Unexpected |
Represents an error value for Expected<T, E>.
Unexpected<E> wraps an error value to be returned from functions that return Expected<T, E>. Use make_unexpected() to construct.
| E | Type of the error value. |
| auto Infinity::Util::make_unexpected | ( | E && | e | ) | -> Unexpected<typename std::decay<E>::type> |
Constructs an Unexpected error value.
Helper function to create an Unexpected<E> for returning errors from functions that return Expected<T, E>.
| E | Type of the error value (automatically deduced). |
| e | Error value to wrap. |