summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2022-05-03 02:00:29 -0400
committerGravatar Morph2022-05-03 17:44:30 -0400
commitf3f3f1b7d94a490b0762db1d1d4040b7d93facdc (patch)
tree1e9ee6c96324eccdbc2569188943cd329eb76c39
parentMerge pull request #8272 from german77/stick_range (diff)
downloadyuzu-f3f3f1b7d94a490b0762db1d1d4040b7d93facdc.tar.gz
yuzu-f3f3f1b7d94a490b0762db1d1d4040b7d93facdc.tar.xz
yuzu-f3f3f1b7d94a490b0762db1d1d4040b7d93facdc.zip
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.
-rw-r--r--src/core/hle/result.h4
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:
181 consteval ResultRange(ErrorModule module, u32 description_start, u32 description_end_) 181 consteval ResultRange(ErrorModule module, u32 description_start, u32 description_end_)
182 : code{module, description_start}, description_end{description_end_} {} 182 : code{module, description_start}, description_end{description_end_} {}
183 183
184 [[nodiscard]] consteval operator ResultCode() const { 184 [[nodiscard]] constexpr operator ResultCode() const {
185 return code; 185 return code;
186 } 186 }
187 187
@@ -232,6 +232,8 @@ public:
232 232
233 constexpr ResultVal(ResultCode code) : expected{Common::Unexpected(code)} {} 233 constexpr ResultVal(ResultCode code) : expected{Common::Unexpected(code)} {}
234 234
235 constexpr ResultVal(ResultRange range) : expected{Common::Unexpected(range)} {}
236
235 template <typename U> 237 template <typename U>
236 constexpr ResultVal(U&& val) : expected{std::forward<U>(val)} {} 238 constexpr ResultVal(U&& val) : expected{std::forward<U>(val)} {}
237 239