Jamba C++ API  5.0.0
Cast< U > Class Template Reference

dynamic_cast<U *>(x) does not compile if x is not polymorphic. More...

#include <Metaprogramming.h>

Static Public Member Functions

template<typename T >
static U dynamic (T *iPtr)
 

Detailed Description

template<typename U>
class pongasoft::Utils::Cast< U >

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.

Member Function Documentation

◆ dynamic()

static U dynamic ( T *  iPtr)
inlinestatic

The documentation for this class was generated from the following file: