Do not use swap for the move-assignment of TDS_3

We can write the operator easily without swap.
This commit is contained in:
Laurent Rineau 2020-01-31 14:19:49 +01:00
parent 290c3a2011
commit f7218dadd6
1 changed files with 3 additions and 2 deletions

View File

@ -251,8 +251,9 @@ public:
Tds & operator= (Tds && tds)
noexcept(noexcept(Tds(std::move(tds))))
{
Tds tmp(std::move(tds));
swap(tmp);
_cells = std::move(tds._cells);
_vertices = std::move(tds._vertices);
_dimension = std::exchange(tds._dimension, -2);
return *this;
}