diff --git a/AK/StdLibExtraDetails.h b/AK/StdLibExtraDetails.h index 4964cda9d0a..15aded72993 100644 --- a/AK/StdLibExtraDetails.h +++ b/AK/StdLibExtraDetails.h @@ -456,6 +456,19 @@ using AssertSize = __AssertSize; template inline constexpr bool IsPOD = __is_pod(T); +template class Base, typename Derived> +struct __IsTemplateBaseOf { + template + static TrueType test(Base const*); + + static FalseType test(...); + + using type = decltype(test(declval())); +}; + +template class Base, typename Derived> +inline constexpr bool IsTemplateBaseOf = __IsTemplateBaseOf::type::value; + template inline constexpr bool IsTrivial = __is_trivial(T); @@ -654,6 +667,7 @@ using AK::Detail::IsSame; using AK::Detail::IsSameIgnoringCV; using AK::Detail::IsSigned; using AK::Detail::IsSpecializationOf; +using AK::Detail::IsTemplateBaseOf; using AK::Detail::IsTrivial; using AK::Detail::IsTriviallyAssignable; using AK::Detail::IsTriviallyConstructible;