Skip to content
Snippets Groups Projects
Commit 19977d37 authored by Andrew Maclean's avatar Andrew Maclean
Browse files

std::unique_ptr has a swap function.

parent 831def7a
No related merge requests found
......@@ -168,10 +168,14 @@ public:
Functor& operator=(const Functor& rhs)
{
Functor copy(rhs);
#if defined(VTK_HAS_STD_UNIQUE_PTR)
spImpl_.swap(copy.spImpl_);
#else
// swap auto_ptrs by hand
Impl* p = spImpl_.release();
spImpl_.reset(copy.spImpl_.release());
copy.spImpl_.reset(p);
#endif
return *this;
}
......@@ -322,10 +326,13 @@ public:
Functor& operator=(const Functor& rhs)
{
Functor copy(rhs);
// swap auto_ptrs by hand
#if defined(VTK_HAS_STD_UNIQUE_PTR)
spImpl_.swap(copy.spImpl_);
#else // swap auto_ptrs by hand
Impl* p = spImpl_.release();
spImpl_.reset(copy.spImpl_.release());
copy.spImpl_.reset(p);
#endif
return *this;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment