Add a move assignment operator to Handle.h

This commit is contained in:
Giles Bathgate 2020-12-06 10:27:15 +00:00
parent a848e52552
commit d29baab363
1 changed files with 7 additions and 0 deletions

View File

@ -68,6 +68,13 @@ class Handle
return *this;
}
Handle&
operator=(Handle&& x) noexcept
{
swap(*this,x);
return *this;
}
friend void swap(Handle& a, Handle& b) noexcept { std::swap(a.PTR, b.PTR); }
void reset()