diff options
author | David <25727384+ogniK5377@users.noreply.github.com> | 2020-08-07 14:59:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-07 14:59:01 +0200 |
commit | 53e94c7be89341ad3d4fac033c6495bedcbdec49 (patch) | |
tree | 8c22b7d574b92de9077dc9c0e1d05fa2947b34b5 /src/common/concepts.h | |
parent | Merge pull request #4483 from lioncash/constexpr-hex (diff) | |
parent | common/concepts: Rename IsBaseOf to DerivedFrom (diff) | |
download | yuzu-53e94c7be89341ad3d4fac033c6495bedcbdec49.tar yuzu-53e94c7be89341ad3d4fac033c6495bedcbdec49.tar.gz yuzu-53e94c7be89341ad3d4fac033c6495bedcbdec49.tar.bz2 yuzu-53e94c7be89341ad3d4fac033c6495bedcbdec49.tar.lz yuzu-53e94c7be89341ad3d4fac033c6495bedcbdec49.tar.xz yuzu-53e94c7be89341ad3d4fac033c6495bedcbdec49.tar.zst yuzu-53e94c7be89341ad3d4fac033c6495bedcbdec49.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/concepts.h | 10 |
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) { t.size(); }; -// Check if type T is derived from T2 -template <typename T, typename T2> -concept IsBaseOf = requires { - std::is_base_of_v<T, T2>; +// TODO: Replace with std::derived_from when the <concepts> header +// is available on all supported platforms. +template <typename Derived, typename Base> +concept DerivedFrom = requires { + std::is_base_of_v<Base, Derived>; + std::is_convertible_v<const volatile Derived*, const volatile Base*>; }; } // namespace Common |