summaryrefslogtreecommitdiff
path: root/src/common/concepts.h
diff options
context:
space:
mode:
authorGravatar Lioncash2020-08-07 07:55:50 -0400
committerGravatar Lioncash2020-08-07 08:09:57 -0400
commit8e86fa7e6033d7d65c781eb332d5d750f7ef4e26 (patch)
tree8c22b7d574b92de9077dc9c0e1d05fa2947b34b5 /src/common/concepts.h
parentMerge pull request #4483 from lioncash/constexpr-hex (diff)
downloadyuzu-8e86fa7e6033d7d65c781eb332d5d750f7ef4e26.tar.gz
yuzu-8e86fa7e6033d7d65c781eb332d5d750f7ef4e26.tar.xz
yuzu-8e86fa7e6033d7d65c781eb332d5d750f7ef4e26.zip
common/concepts: Rename IsBaseOf to DerivedFrom
This makes it more inline with its currently unavailable standardized analogue std::derived_from. While we're at it, we can also make the template match the requirements of the standardized variant as well.
Diffstat (limited to '')
-rw-r--r--src/common/concepts.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/concepts.h b/src/common/concepts.h
index db5fb373d..54252e778 100644
--- a/src/common/concepts.h
+++ b/src/common/concepts.h
@@ -23,10 +23,12 @@ concept IsSTLContainer = requires(T t) {
23 t.size(); 23 t.size();
24}; 24};
25 25
26// Check if type T is derived from T2 26// TODO: Replace with std::derived_from when the <concepts> header
27template <typename T, typename T2> 27// is available on all supported platforms.
28concept IsBaseOf = requires { 28template <typename Derived, typename Base>
29 std::is_base_of_v<T, T2>; 29concept DerivedFrom = requires {
30 std::is_base_of_v<Base, Derived>;
31 std::is_convertible_v<const volatile Derived*, const volatile Base*>;
30}; 32};
31 33
32} // namespace Common 34} // namespace Common