Boost logo

Boost :

From: Martin Bonner (Martin.Bonner_at_[hidden])
Date: 2007-10-10 12:01:14


From: Simonson, Lucanus J

> There are cases where reading
> the C++ standard will inform a developer that reinterpret_cast is safe
> [snip]. Specifically, I submit that inheritance and
> composition are such cases

As I said in my previous email, I don't think so. BUT...

> provided that additional data members are not
> added in the subtype or composed type.

... I missed this.

I still don't think the standard makes the guarantees you think it does,
but in practise, you are much less likely to run into problems with that
limitation.

If the types are inherited (rather than composed) I still think you have
problems if the derived class overrides virtuals in the base.

-- 
Martin Bonner
Senior Software Engineer/Team Leader
PI SHURLOK LTD
Telephone: +44 1223 441434 / 203894 (direct)
Fax: +44 1223 203999
Email: martin.bonner_at_[hidden]
www.pi-shurlok.com
disclaimer

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