19 Aug
2002
19 Aug
'02
9:48 p.m.
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. // Assignment to a 'normal' pointer. shared_ptr & operator=(T * r) { this_type(r).swap(*this); return *this; } I have a few questions. 1) Is this necessary? 2) Does this do the job? 3) Is there any reason this wasn't included in the first place? I welcome any comments. Regards, IanM