Boost logo

Boost :

Subject: Re: [boost] scoped_ptr deleter
From: Stefan Strasser (strasser_at_[hidden])
Date: 2009-09-16 11:54:21

Am Wednesday 16 September 2009 10:34:35 schrieb Berserker:
> Dmitry Goncharov wrote:
> > The difficulty that your example demonstrates is caused by the nature
> > of template template parameters. scoped_ptr should not be blamed for
> that.
> I agree, moreover I think that the advantages of this patch (often
> required in the list)

could you explain what those advantages are?
a scoped_ptr can't be copied at can't be moved. so there are two use cases
left for a scoped_ptr deleter:

 - scoped_ptr as a class member: execute code when the class gets
destructed -> that's what a destructor is for.

 - scoped_ptr as a local variable, execute code when something goes out of
scope -> that's what boost ScopeExit is for.

what is the use case that only a scoped_ptr deleter can handle?

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