19 Aug
2002
19 Aug
'02
11:11 p.m.
On Monday, August 19, 2002, at 02:48 PM, Ian Mold wrote:
I have been looking at the shared_ptr class, and I have made a change to include an assignment from a standard pointer. I have done this so that I don't have to create a new shared_ptr just to reassign an existing shared_ptr.
You can use the reset() member function to do this. You don't need to change the class. Using a named member function (reset) is less error prone because the transfer of ownership is clearer; that's why we don't provide an operator= that "adopts" the passed pointer. -- Darin