Boost logo

Boost :

Subject: Re: [boost] temp_ptr<> - preventing use as a member
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-11-14 11:07:03


On 11/13/2011 04:41 PM, Gottlob Frege wrote:
> I'm trying to see if I can replace all raw pointers with suitable
> smart pointers that clearly describe the pointer's lifetime, sharing,
> etc.
> For example, a pointer passed into a function, that is only valid for
> the lifetime of the function call. A temp_ptr or callstack_ptr or ...
> some better name.

This sounds a lot like scoped_ptr.

> So this pointer would need a copy constructor so it can be passed
> along into a function (I don't think requiring a ref to the pointer
> would be good; I'd rather pass by value).

I don't think this is a good idea. You probably
don't want the copy constructor to copy the
pointee, which means that the destructor doesn't
necessarily call delete...

In Christ,
Steven Watanabe

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