From 8e86fa7e6033d7d65c781eb332d5d750f7ef4e26 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 7 Aug 2020 07:55:50 -0400 Subject: 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. --- src/common/concepts.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/common/concepts.h') 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 -concept IsBaseOf = requires { - std::is_base_of_v; +// TODO: Replace with std::derived_from when the header +// is available on all supported platforms. +template +concept DerivedFrom = requires { + std::is_base_of_v; + std::is_convertible_v; }; } // namespace Common -- cgit v1.2.3