HDK
|
Go to the source code of this file.
Typedefs | |
template<class Src , class Dst > | |
using | Tf_CopyConst = typename std::conditional< std::is_const< Src >::value, typename std::add_const< Dst >::type, Dst >::type |
template<class Src , class Dst > | |
using | Tf_CopyVolatile = typename std::conditional< std::is_volatile< Src >::value, typename std::add_volatile< Dst >::type, Dst >::type |
template<class Src , class Dst > | |
using | Tf_CopyCV = Tf_CopyConst< Src, Tf_CopyVolatile< Src, Dst >> |
Functions | |
template<typename T > | |
std::enable_if < std::is_polymorphic< T > ::value, Tf_CopyCV< T, void > * >::type | TfCastToMostDerivedType (T *ptr) |
template<typename T > | |
std::enable_if < !std::is_polymorphic< T > ::value, Tf_CopyCV< T, void > * >::type | TfCastToMostDerivedType (T *ptr) |
C++ Cast Utilities.
Definition in file cxxCast.h.
using Tf_CopyConst = typename std::conditional<std::is_const<Src>::value, typename std::add_const<Dst>::type, Dst>::type |
using Tf_CopyCV = Tf_CopyConst<Src, Tf_CopyVolatile<Src, Dst>> |
using Tf_CopyVolatile = typename std::conditional<std::is_volatile<Src>::value, typename std::add_volatile<Dst>::type, Dst>::type |
|
inline |
Return a pointer to the most-derived object.
A dynamic_cast
to void*
is legal only for pointers to polymorphic objects. This function returns the original pointer for non-polymorphic types, and a pointer to the most-derived type of the object. Said differently, given a pointer of static type B*
, and given that the object really points to an object of type D*
, this function returns the address of the object considered as a D*
; however, for non-polymorphic objects, the actual type of an object is taken to be B
, since one cannot prove that that the type is actually different.