diff options
| -rw-r--r-- | src/common/concepts.h | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_priority_queue.h | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/common/concepts.h b/src/common/concepts.h index 5bef3ad67..aa08065a7 100644 --- a/src/common/concepts.h +++ b/src/common/concepts.h | |||
| @@ -31,4 +31,8 @@ concept DerivedFrom = requires { | |||
| 31 | std::is_convertible_v<const volatile Derived*, const volatile Base*>; | 31 | std::is_convertible_v<const volatile Derived*, const volatile Base*>; |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | // TODO: Replace with std::convertible_to when libc++ implements it. | ||
| 35 | template <typename From, typename To> | ||
| 36 | concept ConvertibleTo = std::is_convertible_v<From, To>; | ||
| 37 | |||
| 34 | } // namespace Common | 38 | } // namespace Common |
diff --git a/src/core/hle/kernel/k_priority_queue.h b/src/core/hle/kernel/k_priority_queue.h index 01a577d0c..99fb8fe93 100644 --- a/src/core/hle/kernel/k_priority_queue.h +++ b/src/core/hle/kernel/k_priority_queue.h | |||
| @@ -8,11 +8,13 @@ | |||
| 8 | #pragma once | 8 | #pragma once |
| 9 | 9 | ||
| 10 | #include <array> | 10 | #include <array> |
| 11 | #include <concepts> | ||
| 11 | 12 | ||
| 12 | #include "common/assert.h" | 13 | #include "common/assert.h" |
| 13 | #include "common/bit_set.h" | 14 | #include "common/bit_set.h" |
| 14 | #include "common/bit_util.h" | 15 | #include "common/bit_util.h" |
| 15 | #include "common/common_types.h" | 16 | #include "common/common_types.h" |
| 17 | #include "common/concepts.h" | ||
| 16 | 18 | ||
| 17 | namespace Kernel { | 19 | namespace Kernel { |
| 18 | 20 | ||
| @@ -21,7 +23,7 @@ class Thread; | |||
| 21 | template <typename T> | 23 | template <typename T> |
| 22 | concept KPriorityQueueAffinityMask = !std::is_reference_v<T> && requires(T & t) { | 24 | concept KPriorityQueueAffinityMask = !std::is_reference_v<T> && requires(T & t) { |
| 23 | { t.GetAffinityMask() } | 25 | { t.GetAffinityMask() } |
| 24 | ->std::convertible_to<u64>; | 26 | ->Common::ConvertibleTo<u64>; |
| 25 | {t.SetAffinityMask(std::declval<u64>())}; | 27 | {t.SetAffinityMask(std::declval<u64>())}; |
| 26 | 28 | ||
| 27 | { t.GetAffinity(std::declval<int32_t>()) } | 29 | { t.GetAffinity(std::declval<int32_t>()) } |
| @@ -48,9 +50,9 @@ concept KPriorityQueueMember = !std::is_reference_v<T> && requires(T & t) { | |||
| 48 | ->KPriorityQueueAffinityMask; | 50 | ->KPriorityQueueAffinityMask; |
| 49 | 51 | ||
| 50 | { t.GetActiveCore() } | 52 | { t.GetActiveCore() } |
| 51 | ->std::convertible_to<s32>; | 53 | ->Common::ConvertibleTo<s32>; |
| 52 | { t.GetPriority() } | 54 | { t.GetPriority() } |
| 53 | ->std::convertible_to<s32>; | 55 | ->Common::ConvertibleTo<s32>; |
| 54 | }; | 56 | }; |
| 55 | 57 | ||
| 56 | template <typename Member, size_t _NumCores, int LowestPriority, int HighestPriority> | 58 | template <typename Member, size_t _NumCores, int LowestPriority, int HighestPriority> |