Jamba
3.2.0
|
#include <Metaprogramming.h>
Static Public Member Functions | |
template<typename T > | |
static U | dynamic (T *iPtr, typename std::enable_if<!std::is_polymorphic< T >::value >::type *=nullptr) |
template<typename T > | |
static U | dynamic (T *iPtr, typename std::enable_if< std::is_polymorphic< T >::value >::type *=nullptr) |
dynamic_cast<U *>(x) does not compile if x is not polymorphic. This class can be used instead and it will, at compilation time, do the "right" thing. The usage is the following: Cast<U*>::dynamic(x). Note that, unlike dynamic_cast, it does not handle & because the code needs to not fail when x is not polymorphic.
|
inlinestatic |
|
inlinestatic |