Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-04-01 16:02:11


----- Original Message -----
From: "Daryle Walker" <darylew_at_[hidden]>

> > PS
> > I added the trick of sizeof(T); to the delete operators to force the
> > definition of T to be in scope. So I suppose that makes boost::auto_ptr
a
> > little better than std::auto_ptr.
>
> What difference does this make?

It prevents undefined behavior due to the inadvertent deletion of classes
with nontrivial destructors in contexts where the class definition is not
available.

-Dave


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