diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-05-03 02:00:29 -0400 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-05-03 17:44:30 -0400 |
commit | f3f3f1b7d94a490b0762db1d1d4040b7d93facdc (patch) | |
tree | 1e9ee6c96324eccdbc2569188943cd329eb76c39 /src | |
parent | b06f9f2606b7e2965d17e9df4b9a738b425b3cd8 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hle/result.h | 4 |
1 files changed, 3 insertions, 1 deletions
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 <typename U> constexpr ResultVal(U&& val) : expected{std::forward<U>(val)} {} |