Commit d695a117 authored by Philip Trettner's avatar Philip Trettner
Browse files

removed test for self-move

parent dea6da5e
...@@ -26,12 +26,10 @@ struct unique_array ...@@ -26,12 +26,10 @@ struct unique_array
} }
unique_array& operator=(unique_array&& rhs) noexcept unique_array& operator=(unique_array&& rhs) noexcept
{ {
if (this != &rhs) // self-move results in moved-from state
{ delete[] ptr;
delete[] ptr; ptr = rhs.ptr;
ptr = rhs.ptr; rhs.ptr = nullptr;
rhs.ptr = nullptr;
}
return *this; return *this;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment