fix move-ctor and move-assignement operator of graphics(#253)
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user