diff --git a/include/xo/unit/Quantity.hpp b/include/xo/unit/Quantity.hpp index 4fb6baf2..2a7f1480 100644 --- a/include/xo/unit/Quantity.hpp +++ b/include/xo/unit/Quantity.hpp @@ -191,6 +191,20 @@ namespace xo { return x.scale() <=> y2.scale(); } + /* also works with Quantity2 = double, int, .. */ + template + Quantity & operator*= (const Quantity2 & x) { + *this = *this * x; + return *this; + } + + /* also works with Quantity2 = double, int, .. */ + template + Quantity & operator/= (const Quantity2 & x) { + *this = *this / x; + return *this; + } + private: /** @brief quantity represents this multiple of a unit amount **/ Repr scale_ = Repr{};