xo-unit: + unary Quantity.operator-

This commit is contained in:
Roland Conybeare 2024-04-27 11:10:55 -04:00
commit 8d1bdf5463
2 changed files with 8 additions and 0 deletions

View file

@ -195,6 +195,10 @@ namespace xo {
return x.scale() <=> y2.scale();
}
Quantity operator-() const {
return Quantity(-scale_, unit_);
}
/* also works with Quantity2 = double, int, .. */
template <typename Quantity2>
Quantity & operator*= (const Quantity2 & x) {