Boost logo

Boost :

From: Moore, Dave (dmoore_at_[hidden])
Date: 2002-07-30 16:46:38


>
> Y * pY = new Derived;
> delete pY;
>
> Will result in a segmentation fault. It is already not
> handled properly
> with raw pointers. ptr<Derived, Y> is just a 'feature'.

No, it won't cause a segmentation fault, as long as Derived and Y have
virtual destructors, which is a requirement for safely manipulating derived
objects through base pointers in the first place.

Regards,
Dave


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