Boost logo

Boost :

From: Chris Just (cpjust_at_[hidden])
Date: 2005-02-13 14:49:33


Jonathan Turkanis wrote:
> There is a policy-based pointer, based on the Loki SmartPtr, coming up for
> review soon which can emulate an auto_ptr and allows deletion policy to be
> specified as part of the 'storage policy'.

I don't know much about the Loki SmartPtr, but it sounds like it might be a little hard to use if
you need to setup policies... I wanted to create a very simple AutoPtr that was essentially the
same as the STL auto_ptr (and backwards compatible with it).

> I only looked very briefly, but I don't see how your auto_ptr can be returned
> from functions. Also, why do you need the m_Owner variable?

Correct me if I'm wrong, but wasn't there a specific reason why the STL auto_ptr was made so it
couldn't be passed to or returned from a function? I don't have my Stroustrup book with me to
check.
Anyways, if you want to pass or return the pointer to/from a function, just use the .get() or
.release() functions.

I need the m_Owner variable to tell me if I own the pointer before I delete it.

   Chris Just

                
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
 


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