Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-10-11 16:23:29


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk