M
m0shbear
Given
#include <cassert>
void f(void *p) {
//...
assert(dynamic_cast<Q*>(p));
//...
}
Would the dynamic_cast comparison method work for runtime testing of a
pointer's expected type without relying on typeid(p).name() ?
Note: this applies to pointers to C types, not just classes.
#include <cassert>
void f(void *p) {
//...
assert(dynamic_cast<Q*>(p));
//...
}
Would the dynamic_cast comparison method work for runtime testing of a
pointer's expected type without relying on typeid(p).name() ?
Note: this applies to pointers to C types, not just classes.