From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2005-02-14 14:02:36
On Mon, 14 Feb 2005 09:41:20 -0800 (PST), Chris Just <cpjust_at_[hidden]> wrote:
> >> I don't set my pointer to NULL when I release() it, I just set
> >> m_Owner = false.
> > This behavior is not compatible with std::auto_ptr.
> I could change it to set the pointer to NULL, but this is what Microsoft's auto_ptr does,
> and it looked safer.
Keeping an address that you no longer control around sounds a LOT less
safe than setting it to 0 to me.
The STL implementation that shipped with VC6 and which you've used as
your jumping-off-point is known to be exceedingly buggy. The auto_ptr
in VC7.x sets its internally held pointer to 0 in the release method
(and no longer has an owner flag).
-- Caleb Epstein caleb dot epstein at gmail dot com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk