forked from boostorg/smart_ptr
scoped_ptr::reset changed to copy+swap (problem reported by Thomas Witt)
[SVN r15239]
This commit is contained in:
@ -61,10 +61,9 @@ public:
|
|||||||
|
|
||||||
void reset(T * p = 0) // never throws
|
void reset(T * p = 0) // never throws
|
||||||
{
|
{
|
||||||
if (ptr != p)
|
if(ptr != p)
|
||||||
{
|
{
|
||||||
checked_delete(ptr);
|
this_type(p).swap(*this);
|
||||||
ptr = p;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user