diff --git a/include/xo/unit/Quantity.hpp b/include/xo/unit/Quantity.hpp index aaf29d73..d24f2589 100644 --- a/include/xo/unit/Quantity.hpp +++ b/include/xo/unit/Quantity.hpp @@ -214,6 +214,24 @@ namespace xo { return Quantity::multiply(x, y); } + /** note: does not require unit scaling, so constexpr with c++23 **/ + template + requires std::is_arithmetic_v && quantity2_concept + constexpr auto + operator* (Dimensionless x, const Quantity & y) + { + return y.scale_by(x); + } + + /** note: does not require unit scaling, so constexpr with c++23 **/ + template + requires std::is_arithmetic_v && quantity2_concept + constexpr auto + operator* (const Quantity & x, Dimensionless y) + { + return x.scale_by(y); + } + /** note: won't have constexpr result until c++26 (when ::sqrt(), ::pow() are constexpr) **/ template