mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 14:52:45 +01:00
Merge pull request #8300 from Morph1984/resultval-range
hle/result: Add ResultRange overload in ResultVal
This commit is contained in:
commit
18a0c2e9db
1 changed files with 4 additions and 2 deletions
|
@ -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)} {}
|
||||
|
||||
|
@ -317,7 +319,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
// TODO: Replace this with std::expected once it is standardized in the STL.
|
||||
// TODO (Morph): Replace this with C++23 std::expected.
|
||||
Common::Expected<T, ResultCode> expected;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue