xo-unit: + Quantity:: operator*= operator/=
This commit is contained in:
parent
022b1da059
commit
0eec013321
1 changed files with 14 additions and 0 deletions
|
|
@ -191,6 +191,20 @@ namespace xo {
|
|||
return x.scale() <=> y2.scale();
|
||||
}
|
||||
|
||||
/* also works with Quantity2 = double, int, .. */
|
||||
template <typename Quantity2>
|
||||
Quantity & operator*= (const Quantity2 & x) {
|
||||
*this = *this * x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* also works with Quantity2 = double, int, .. */
|
||||
template <typename Quantity2>
|
||||
Quantity & operator/= (const Quantity2 & x) {
|
||||
*this = *this / x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
/** @brief quantity represents this multiple of a unit amount **/
|
||||
Repr scale_ = Repr{};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue