Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-12-27 09:23:53


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?

-Dave

----- Original Message -----
From: "Beman Dawes" <beman_at_[hidden]>
To: <boost_at_[hidden]>; <boost_at_[hidden]>
Sent: Wednesday, December 27, 2000 8:45 AM
Subject: Re: [boost] Suggestion: scoped_ptr::release()

> 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();
> }
>
> [I've corrected the typo in the example code that confused everyone.
Let's
> start the discussion again, realizing that what we are talking about is
> scoped_ptr<>, not shared_ptr<>. --Beman]
>
>
>
>


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