|
Boost Users : |
Subject: Re: [Boost-users] shared_ptr and inheritance
From: Igor R (boost.lists_at_[hidden])
Date: 2009-10-22 05:54:51
>
> Maybe this is a simple question but...
> Suppose to have:
>
> template<typename T>
> class Base {...};
>
> template<typename T>
> class Derived : public Base<T> {...};
>
> and
>
> shared_ptr< Base<T> > BasePtr;
> shared_ptr< Derived<T> > DerivedPtr;
>
> How can assign BasePtr to DerivedPtr?
>
boost::static_pointer_cast<Derived<T> >(p)
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net