From de4fdcd89854e935e3fc650fe1ddf5bd23f95fe2 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 22 Jan 2024 16:59:14 +0200 Subject: [PATCH] BAN: Implement is_base_of and integral_constant to Traits --- BAN/include/BAN/Traits.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BAN/include/BAN/Traits.h b/BAN/include/BAN/Traits.h index b85b7073..58850af6 100644 --- a/BAN/include/BAN/Traits.h +++ b/BAN/include/BAN/Traits.h @@ -84,6 +84,12 @@ namespace BAN template struct is_arithmetic { static constexpr bool value = is_integral_v || is_floating_point_v; }; template inline constexpr bool is_arithmetic_v = is_arithmetic::value; + template struct is_base_of { static constexpr bool value = __is_base_of(Base, Derived); }; + template inline constexpr bool is_base_of_v = is_base_of::value; + + template struct integral_constant { static constexpr T value = V; }; + template inline constexpr T integral_constant_v = integral_constant::value; + namespace detail { template> struct is_signed { static constexpr bool value = T(-1) < T(0); };