Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-29 16:42:19


----- Original Message -----
From: "Vladimir Prus" <ghost_at_[hidden]>

> >> I know that. I meant to state that, in my opinion, this doesn't prevent
> body
> >> from having non-trivial dtor and *have it called*,
>
> >True.
>
> Then, scoped_ptr's docs contain an incorrect statement, and that is better
> fixed.

Agreed. Greg?

> >> , and that one can assure that you never call delete on an object with
> >> incomplete type.
>
> >How?
>
> As I have stated in previous post, with sizeof(T):
>
> ~scoped_ptr() {
> sizeof(T);
> delete p;
> }

Ah, wonderful. We should put this riff in boost/utility.hpp

template <class T>
void delete_(T const volatile* x)
{
    sizeof(T);
    delete x;
}

Then "delete x" becomes boost::delete_(x)

-Dave


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