cisst-saw
|
#include <cmnTypeTraits.h>
Public Types | |
enum | { IS_DERIVED = sizeof(Test(static_cast<T*>(0))) == sizeof(One) } |
enum | { IS_NOT_DERIVED = !IS_DERIVED } |
Check whether class T is derived from class templated class Base. This is especially convenient when the template argument to the Base class is not known.
Examples: cmnIsDerivedFromTemplated<double, cmnGenericObjectProxy>::IS_DERIVED is false cmnIsDerivedFromTemplated<cmnDouble, cmnGenericObjectProxy>::IS_DERIVED is true
Note that if you know the template argument to the Base class, you can instead use: cmnIsDerivedFrom<cmnDouble, cmnGenericObjectProxy<double> >::IS_DERIVED