From 310776990db7cae028257d5810ad2c095d7534b2 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Mon, 3 Aug 2020 20:36:25 +1000 Subject: [PATCH] Add Common::IsBaseOf --- src/common/concepts.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/concepts.h b/src/common/concepts.h index 6def398cde..db5fb373d9 100644 --- a/src/common/concepts.h +++ b/src/common/concepts.h @@ -6,6 +6,8 @@ namespace Common { +#include + // Check if type is like an STL container template concept IsSTLContainer = requires(T t) { @@ -21,4 +23,10 @@ concept IsSTLContainer = requires(T t) { t.size(); }; +// Check if type T is derived from T2 +template +concept IsBaseOf = requires { + std::is_base_of_v; +}; + } // namespace Common