From: Darin Adler (darin_at_[hidden])
Date: 2002-04-24 16:13:43
On Wednesday, April 24, 2002, at 01:26 PM, Fernando Cacciola wrote:
> The conversion from Derived* to Base* might require a pointer fixup.
> requires RTTI. C++ doesn't force the use of RTTI unless dynamic_cast<>
> used, so the implicit conversion could go wrong in exactly the same
> way a
> C-style cast could go wrong if the conversion requires pointer value
> IOWs, the template constructor acts exactly like a C-style cast between
> arbitrary pointers. If dynamic_cast<> isn't required in this situation,
> when is it?
Conversion from Derived* to Base* might require a pointer fixup, but it
*never* requires RTTI.
The purpose of polymorphic_cast is to help for conversions from Base* to
Derived*. These types of conversions are never done automatically. They
always require some kind of cast.
This is not a problem with Peter's proposal.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk