From f3f3f1b7d94a490b0762db1d1d4040b7d93facdc Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Tue, 3 May 2022 02:00:29 -0400 Subject: hle/result: Add ResultRange overload in ResultVal Also marks the implicit conversion operator as constexpr instead of consteval as the constructor is not constant evaluated. --- src/core/hle/result.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 8d38d0030..1a74a7402 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -181,7 +181,7 @@ public: consteval ResultRange(ErrorModule module, u32 description_start, u32 description_end_) : code{module, description_start}, description_end{description_end_} {} - [[nodiscard]] consteval operator ResultCode() const { + [[nodiscard]] constexpr operator ResultCode() const { return code; } @@ -232,6 +232,8 @@ public: constexpr ResultVal(ResultCode code) : expected{Common::Unexpected(code)} {} + constexpr ResultVal(ResultRange range) : expected{Common::Unexpected(range)} {} + template constexpr ResultVal(U&& val) : expected{std::forward(val)} {} -- cgit v1.2.3