
14 Feb
2005
14 Feb
'05
7:02 p.m.
On Mon, 14 Feb 2005 09:41:20 -0800 (PST), Chris Just <cpjust@yahoo.com> 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