Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-09-24 09:07:46


Martin Bosticky wrote:
> Hi
>
> I have a question about implementation of shared_ptr when used to
> store classes with inheritance.
>
> I have a shared pointer to an abstract class and would like to convert
> it to a pointer to the derived class. Is there a way to do this already?

Use static_pointer_cast, dynamic_pointer_cast, or add a "get_derived()"
member function to the abstract class.


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