Virtual destructor for polymorphic classes, const correctness, removed virtual method call in constructor

This commit is contained in:
Klaus Basan
2013-03-24 17:15:08 +01:00
parent 3b99954bdc
commit b3439ea3e4
18 changed files with 320 additions and 183 deletions

View File

@@ -58,10 +58,18 @@ int main(int argc, char *argv[])
qDebug() << t1 << t2 << t2.convertedSiValueRoundedWithUnit();
qDebug() << t3 << t3.valueRoundedWithUnit(CTemperatureUnit::C());
// some logging wit CLogMessage
// some logging with CLogMessage
bDebug << p1;
bDebug << p1.getUnit() << p1.getUnit().getMultiplier();
// some of the faults Mathew has pointed out,not longer possible
// CAngleUnit::rad() = CAngleUnit::deg();
// qDebug() << CAngleUnit::rad(); // wrong
(t1 - t2).switchUnit(CTemperatureUnit::F()); // was not working since wrong return type const
// CDistanceUnit duA(CSpeedUnit::ft_min()); // no longer possible
CDistanceUnit duB(CDistanceUnit::cm());
qDebug() << duB;
// bye
return a.exec();
}