eo-cxx: Fix assignment operator for eo::concrete

This commit is contained in:
Felipe Magno de Almeida 2017-09-17 06:15:26 -03:00
parent 151d7a6517
commit 192c7e35f6
1 changed files with 11 additions and 2 deletions

View File

@ -102,8 +102,8 @@ struct concrete
concrete& operator=(concrete&& other)
{
concrete tmp(other);
std::swap(*this, tmp);
concrete tmp(std::move(other));
swap(tmp);
return *this;
}
@ -140,6 +140,15 @@ struct concrete
{
return _eo_raw;
}
friend void swap(concrete& lhs, concrete& rhs)
{
lhs.swap(rhs);
}
void swap(concrete& other)
{
std::swap(_eo_raw, other._eo_raw);
}
protected:
Eo* _eo_raw; ///< The opaque <em>EO Object</em>.
};