KarmaEngine
Game Engine for practical learning and research purposes
|
Is type DerivedType inherited from BaseType? More...
#include <SubClassOf.h>
Public Types | |
typedef char | No[1] |
typedef char | Yes[2] |
Static Public Member Functions | |
static Yes & | Test (BaseType *) |
Handy function called when type-cast succeeds. | |
static Yes & | Test (const BaseType *) |
Handy variant function called when type-cast succeeds. | |
static No & | Test (...) |
Handy function called when type-cast does not succeed. | |
static DerivedType * | DerivedTypePtr () |
Static Public Attributes | |
static constexpr bool | Value = sizeof(Test(DerivedTypePtr())) == sizeof(Yes) |
static constexpr bool | IsDerived = Value |
Is type DerivedType inherited from BaseType?
typedef char Karma::TIsDerivedFrom< DerivedType, BaseType >::No[1] |
When polymorphism fails, i.e there is no child-parent type relation for DerivedType and BaseType.
typedef char Karma::TIsDerivedFrom< DerivedType, BaseType >::Yes[2] |
When polymorphism succeeds, i.e there is child-parent type relation for DerivedType and BaseType.
|
inlinestatic |
Makes a DerivedType ptr
|
static |
|
static |
|
static |
|
staticconstexpr |
Test the derived type pointer. If it inherits from BaseType, the Test( BaseType* ) will be chosen. If it does not, Test( ... ) will be chosen.