Hello Jerry!
You wrote to Darin McBride...
DM> I thought that RTTI _could_ do this for pointers to void.
...
JC> Some looking in the standard shows that I was dead wrong. You should be
JC> able to use a dynamic_cast to do the job. I'm still not sure how the
JC> compiler can ensure that it'll work, but I guess that's its problem.
IIRC, the draft standard specifies that RTTI is only available for classes
that have at least one virtual function. If so, it's fairly clear that the
compiler only has to go to the memory pointed to by the original void
pointer, look at the "standard" offset in the (presumed) object for the
vtable pointer, and then determine if the data at that offset is a pointer
that points to a true vtable.
ttfn
-Ron (rbass@intersecttech.com)
--- EZPoint V2.2
---------------
* Origin: There's a point here, somewhere... (1:128/13.3)
|