Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-12-27 12:07:32


At 09:23 AM 12/27/2000 -0500, David Abrahams wrote:

>I always thought that "no transfer of ownership" was part of the point of
>scoped_ptr<>. Why not just use std::auto_ptr<> if you want to do this?

Yes, why not?

The decision not to include release() was a conscious one; basically I'd
like to see that reaffirmed, and then I'll add a FAQ question "why isn't
there a release()?" to the docs.

--Beman

>> At 07:38 PM 12/19/2000 -0500, Joe Gottman wrote:
>>
>> I think the scoped_ptr class should have a release() function,
>similar
>> to the one in std::auto_ptr. This would help in cases like the
following
>>
>> int *foo() {
>> scoped_ptr<int> the_pointer(new int());
>> //Do stuff that might throw
>> return the_pointer.release();
>> }


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