
11 Oct
2007
11 Oct
'07
8:23 p.m.
AMDG Fernando Cacciola <fernando_cacciola <at> hotmail.com> writes:
Anyway, let's not digress. This started becasue you mentioned that you used reinterpret_cast<>, but your are using static_cast<> instead. As long as you don't step over "void*" in the way fom one type to another, static_cast<> is perfectly safe. If you were to screw up the derived class in such a way that it prevents the cast to be 100% safe, the compiler will just reject your code. That's why static_cast<> was invented for.
Yes but casting to a derived sub-object that doesn't exist yields undefined behavior when you attempt to call a non-static member function of the derived class. In Christ, Steven Watanabe