Boost logo

Boost :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2002-01-21 10:05:00


David Abrahams wrote:

> ----- Original Message -----
> From: "Larry Evans" <jcampbell3_at_[hidden]>
>
> > Now, about counted_base. Since one of the purposes of counted_base is to
> > overcome the lack of virtual DTOR, could John Maddox's is_polymorphic<>
> > trait be used to provide a specialized version of counted_base_impl
> without the
> > extra D del pointer?
>
> struct A {};
> struct B { virtual ~B(); };
>
> shared_ptr<B> x(new B());
> shared_ptr<A> y(x); // <--- what happens here?
>
> struct C { virtual void f(); }
> struct D : C { };
>
> shared_ptr<D> d(new D);
> shared_ptr<C> c(d); // <--- or here?

Your examples make it clear to me that the del pointer
can't be avoided.

Thanks.


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