summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2020-12-29 20:26:16 +0100
committercomex <comexk@gmail.com>2020-12-29 20:33:41 +0100
commit388cf58b31d6480007901785851e6369b0efe64b (patch)
tree526f9692f15be9f946511082692420f4971104a8
parentMerge pull request #5236 from gal20/udp_client_patch (diff)
downloadyuzu-388cf58b31d6480007901785851e6369b0efe64b.tar
yuzu-388cf58b31d6480007901785851e6369b0efe64b.tar.gz
yuzu-388cf58b31d6480007901785851e6369b0efe64b.tar.bz2
yuzu-388cf58b31d6480007901785851e6369b0efe64b.tar.lz
yuzu-388cf58b31d6480007901785851e6369b0efe64b.tar.xz
yuzu-388cf58b31d6480007901785851e6369b0efe64b.tar.zst
yuzu-388cf58b31d6480007901785851e6369b0efe64b.zip
-rw-r--r--src/common/concepts.h4
-rw-r--r--src/core/hle/kernel/k_priority_queue.h8
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 {
std::is_convertible_v<const volatile Derived*, const volatile Base*>;
};
+// TODO: Replace with std::convertible_to when libc++ implements it.
+template <typename From, typename To>
+concept ConvertibleTo = std::is_convertible_v<From, To>;
+
} // 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 @@
#pragma once
#include <array>
+#include <concepts>
#include "common/assert.h"
#include "common/bit_set.h"
#include "common/bit_util.h"
#include "common/common_types.h"
+#include "common/concepts.h"
namespace Kernel {
@@ -21,7 +23,7 @@ class Thread;
template <typename T>
concept KPriorityQueueAffinityMask = !std::is_reference_v<T> && requires(T & t) {
{ t.GetAffinityMask() }
- ->std::convertible_to<u64>;
+ ->Common::ConvertibleTo<u64>;
{t.SetAffinityMask(std::declval<u64>())};
{ t.GetAffinity(std::declval<int32_t>()) }
@@ -48,9 +50,9 @@ concept KPriorityQueueMember = !std::is_reference_v<T> && requires(T & t) {
->KPriorityQueueAffinityMask;
{ t.GetActiveCore() }
- ->std::convertible_to<s32>;
+ ->Common::ConvertibleTo<s32>;
{ t.GetPriority() }
- ->std::convertible_to<s32>;
+ ->Common::ConvertibleTo<s32>;
};
template <typename Member, size_t _NumCores, int LowestPriority, int HighestPriority>