I want to use a dynamic_cast
intrinsic in my generated C++ code. The macro definition looks like:
#define jcast(T, v) (dynamic_cast<T*>(v))
Unfortunately, because the code is generated, this situation can occur:
foo(jcast(UWiseObject, NULL));
A compiler said that:
error: `nullptr_t` is not a pointer.
How can I rescue NULL
in this situation? I really want something like:
if (v)
return dynamic_cast<T*>(v);
else
return NULL;