
23 Feb
2006
23 Feb
'06
5:33 p.m.
On 2/23/06, David Gruener <gruenedd@idmt.fraunhofer.de> wrote:
It seems that the polymorphic casts are deprecated without replacement with the new *_pointer_cast style. Why?
Are you asking why e.g: boost::shared_ptr<Base> b (new Derived); boost::shared_ptr<Derived> d = boost::dynamic_pointer_cast<Derived> (b); is used instead of: boost::shared_ptr<Derived> d = dynamic_cast<Derived*> (b.get()); ? I think the answer is that there would be no way for the reference count to be shared between "b" and "d" without Base deriving from boost::shared_from_this, so there would be no way to correctly determine when to delete the pointee. -- Caleb Epstein caleb dot epstein at gmail dot com