diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2025-09-13 19:05:33 -0500 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2025-09-13 19:05:33 -0500 |
| commit | 071dedd492dd828727f87aec4be15a851f5282f1 (patch) | |
| tree | cc618c9d3e9c7073709d7faa9aa107fe5c272bc0 /Source/Core/VideoCommon/OpcodeDecoding.h | |
| parent | 695e06ca981dee93a2be517594b7c622bf18d41f (diff) | |
VideoCommon/OpcodeDecoding: Replace enable_if with concepts.
Diffstat (limited to 'Source/Core/VideoCommon/OpcodeDecoding.h')
| -rw-r--r-- | Source/Core/VideoCommon/OpcodeDecoding.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/OpcodeDecoding.h b/Source/Core/VideoCommon/OpcodeDecoding.h index 36a56a0fe2..bf9b94d218 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.h +++ b/Source/Core/VideoCommon/OpcodeDecoding.h @@ -3,7 +3,7 @@ #pragma once -#include <type_traits> +#include <concepts> #include "Common/Assert.h" #include "Common/CommonTypes.h" @@ -122,8 +122,8 @@ public: namespace detail { // Main logic; split so that the main RunCommand can call OnCommand with the returned size. -template <typename T, typename = std::enable_if_t<std::is_base_of_v<Callback, T>>> -static DOLPHIN_FORCE_INLINE u32 RunCommand(const u8* data, u32 available, T& callback) +static DOLPHIN_FORCE_INLINE u32 RunCommand(const u8* data, u32 available, + std::derived_from<Callback> auto& callback) { if (available < 1) return 0; @@ -253,8 +253,8 @@ static DOLPHIN_FORCE_INLINE u32 RunCommand(const u8* data, u32 available, T& cal } } // namespace detail -template <typename T, typename = std::enable_if_t<std::is_base_of_v<Callback, T>>> -DOLPHIN_FORCE_INLINE u32 RunCommand(const u8* data, u32 available, T& callback) +DOLPHIN_FORCE_INLINE u32 RunCommand(const u8* data, u32 available, + std::derived_from<Callback> auto& callback) { const u32 size = detail::RunCommand(data, available, callback); if (size > 0) @@ -264,8 +264,8 @@ DOLPHIN_FORCE_INLINE u32 RunCommand(const u8* data, u32 available, T& callback) return size; } -template <typename T, typename = std::enable_if_t<std::is_base_of_v<Callback, T>>> -DOLPHIN_FORCE_INLINE u32 Run(const u8* data, u32 available, T& callback) +DOLPHIN_FORCE_INLINE u32 Run(const u8* data, u32 available, + std::derived_from<Callback> auto& callback) { u32 size = 0; while (size < available) |
