|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2002-07-30 15:19:44
"Philippe A. Bouchard" <philippeb_at_[hidden]> wrote in message
news:ai6r2j$534$1_at_main.gmane.org...
> [...]
> ptr<Derived> pD = new Derived;
> ptr<Derived, X> pX = new X;
> ptr<Derived, Y> pY = new Y;
>
> pX = pD; // Won't work
> pY = pD; // Won't work
> [...]
Of course, this syntax is clumsier than existing pointers, and also less
powerful. For instance, you may have code that knows about X or Y,
but not about anything derived from X or Y. Your proposal requires
such code to know about all possible derivatives in order to work
properly, which is a fairly restrictive requirement.
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk