Discussion:
[LyX/master] Fix Tabular::CellData::operator=()
Jean-Marc Lasgouttes
2014-07-07 13:42:49 UTC
Permalink
commit 0092b523c7d3c1735b6854bcbdb4e65ec782f092
Date: Sat Jul 5 11:44:13 2014 +0200
Fix Tabular::CellData::operator=()
Don't create an intermediate copy (found by Jean-Marc).
I doubt that this has anything to do with the mystery crash, but it works, and
following the standard patterns is better anyway.
Is there a reason for keeping CellData::swap now? What does it do that
std::swap(CellData&, CellData&) does not do?

JMarc
Georg Baum
2014-07-07 19:15:58 UTC
Permalink
Post by Jean-Marc Lasgouttes
Is there a reason for keeping CellData::swap now? What does it do that
std::swap(CellData&, CellData&) does not do?
Good question, I did not think about it (Length::swap() is similar btw). It
does exactly the same, the only reason to want it that comes to my mind is
that std containers have swap() as member function as well, so you can do

a.swap(b);

However, the code duplication is worse, so I'll remove both mentioned swap()
methods.


Georg

Loading...