fix move-ctor and move-assignement operator of graphics(#253)

This commit is contained in:
Jinhao
2017-09-12 08:15:22 +08:00
parent b0a58ed62f
commit 803acb13f0

View File

@@ -240,12 +240,16 @@ namespace paint
graphics::graphics(graphics&& other) graphics::graphics(graphics&& other)
: impl_(std::move(other.impl_)) : impl_(std::move(other.impl_))
{ {
other.impl_.reset(new implementation);
} }
graphics& graphics::operator=(graphics&& other) graphics& graphics::operator=(graphics&& other)
{ {
if (this != &other) if (this != &other)
{
impl_ = std::move(other.impl_); impl_ = std::move(other.impl_);
other.impl_.reset(new implementation);
}
return *this; return *this;
} }