xo-unit: + unary Quantity.operator-
This commit is contained in:
parent
e1fee23cdc
commit
8d1bdf5463
2 changed files with 8 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue