diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-11-02 22:23:19 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-11-02 22:23:19 +0100 |
commit | cb09ea0f0174162a85f47fdb8446b397c3c57e20 (patch) | |
tree | 5cbd9a62e1daf1c1de97444858064fe8210df077 /src/core/hle/result.h | |
parent | hle/result: Amend ResultVal documentation (diff) | |
download | yuzu-cb09ea0f0174162a85f47fdb8446b397c3c57e20.tar yuzu-cb09ea0f0174162a85f47fdb8446b397c3c57e20.tar.gz yuzu-cb09ea0f0174162a85f47fdb8446b397c3c57e20.tar.bz2 yuzu-cb09ea0f0174162a85f47fdb8446b397c3c57e20.tar.lz yuzu-cb09ea0f0174162a85f47fdb8446b397c3c57e20.tar.xz yuzu-cb09ea0f0174162a85f47fdb8446b397c3c57e20.tar.zst yuzu-cb09ea0f0174162a85f47fdb8446b397c3c57e20.zip |
Diffstat (limited to 'src/core/hle/result.h')
-rw-r--r-- | src/core/hle/result.h | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index a1917d32b..3807b9aa8 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -168,7 +168,7 @@ constexpr ResultCode ResultUnknown(UINT32_MAX); * return ResultCode{ErrorModule::Common, 1}; * } else { * // Frobnicated! Give caller a cookie - * return MakeResult(42); + * return 42; * } * } * \endcode @@ -280,24 +280,6 @@ private: }; /** - * This function is a helper used to construct `ResultVal`s. It receives the arguments to construct - * `T` with and creates a `ResultVal` that contains the constructed value. - */ -template <typename T, typename... Args> -[[nodiscard]] ResultVal<T> MakeResult(Args&&... args) { - return ResultVal<T>{std::forward<Args>(args)...}; -} - -/** - * Deducible overload of MakeResult, allowing the template parameter to be ommited if you're just - * copy or move constructing. - */ -template <typename T> -[[nodiscard]] ResultVal<std::remove_cvref_t<T>> MakeResult(T&& val) { - return ResultVal<std::remove_cvref_t<T>>{std::forward<T>(val)}; -} - -/** * Check for the success of `source` (which must evaluate to a ResultVal). If it succeeds, unwraps * the contained value and assigns it to `target`, which can be either an l-value expression or a * variable declaration. If it fails the return code is returned from the current function. Thus it |