diff --git a/Redcraft.Utility/Source/Private/Testing/TypeTraitsTesting.cpp b/Redcraft.Utility/Source/Private/Testing/TypeTraitsTesting.cpp index bef5256..ce2a98f 100644 --- a/Redcraft.Utility/Source/Private/Testing/TypeTraitsTesting.cpp +++ b/Redcraft.Utility/Source/Private/Testing/TypeTraitsTesting.cpp @@ -322,6 +322,10 @@ void TestTypeTraits() always_check(!(CConvertibleTo)); always_check((CConvertibleTo)); + always_check(!(CDerivedFrom)); + always_check(!(CDerivedFrom)); + always_check((CDerivedFrom)); + always_check((CSameAs>)); always_check(!(CSameAs>)); always_check(!(CSameAs>)); diff --git a/Redcraft.Utility/Source/Public/TypeTraits/Miscellaneous.h b/Redcraft.Utility/Source/Public/TypeTraits/Miscellaneous.h index db539a8..afbe446 100644 --- a/Redcraft.Utility/Source/Public/TypeTraits/Miscellaneous.h +++ b/Redcraft.Utility/Source/Public/TypeTraits/Miscellaneous.h @@ -31,6 +31,7 @@ template inline constexpr size_t TExtent = NAMESPACE template concept CSameAs = NAMESPACE_STD::is_same_v; template concept CBaseOf = NAMESPACE_STD::is_base_of_v; template concept CConvertibleTo = NAMESPACE_STD::is_convertible_v; +template concept CDerivedFrom = CBaseOf && CConvertibleTo; template using TRemoveConst = NAMESPACE_STD::remove_const_t; template using TRemoveVolatile = NAMESPACE_STD::remove_volatile_t;