Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2003-02-12 09:09:03


Philippe A. Bouchard wrote:

[...]

> Well in fact, the following assignment could be verified at
> compile-time
> with some smart_ptr<> checking policy:
>
> class A { char c; };
>
> class B { char c; };
>
> class C : public A, public B { char c; };

smart_ptr<C> pC = new C;

smart_ptr<A> pA = pC; // Ok.

smart_ptr<B> pB = new B; // [<- correction here] Ok.

smart_ptr<B> pB = pC; // Generate compile-time error.

smart_ptr<B> pB = new C; // Generate compile-time error.

Philippe A. Bouchard


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