Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-04-02 17:59:26

At 10:25 AM 3/29/2001, Vladimir Prus wrote:

>Then, scoped_ptr's docs contain an incorrect statement, and that is

I think it is unclear, but not incorrect. There is nothing wrong with
deleting a pointer to an incomplete type if the type has a trivial
destructor, AFAIK. I'll rewrite it tomorrow when I feel a bit sharper, and
post the rewrite here for comment.

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

If you did that, scoped_ptr could not be used with incomplete
types. Although you have to be careful that the destructor is trivial, it
is highly desirable to be able to use scoped_ptr with incomplete types. I
must be missing your point.


Boost list run by bdawes at, gregod at, cpdaniel at, john at