diff --git a/deps/ox/src/ox/std/error.hpp b/deps/ox/src/ox/std/error.hpp index 3e0aed61..4af771af 100644 --- a/deps/ox/src/ox/std/error.hpp +++ b/deps/ox/src/ox/std/error.hpp @@ -56,6 +56,9 @@ struct [[nodiscard]] Error { template struct [[nodiscard]] Result { + + using type = T; + T value; Error error; @@ -111,4 +114,7 @@ inline void oxIgnoreError(ox::Error) noexcept {} #define oxReturnError(x) if (const auto _ox_error = ox::detail::toError(x)) return _ox_error #define oxThrowError(x) if (const auto _ox_error = ox::detail::toError(x)) throw _ox_error #endif +#define oxConcatImpl(a, b) a##b +#define oxConcat(a, b) oxConcatImpl(a, b) +#define oxRequire(out, x) auto [out, oxConcat(oxRequire_err_, __LINE__)] = x; oxReturnError(oxConcat(oxRequire_err_, __LINE__))