diff --git a/include/xo/unit/xquantity.hpp b/include/xo/unit/xquantity.hpp index 84807aa4..92e31a89 100644 --- a/include/xo/unit/xquantity.hpp +++ b/include/xo/unit/xquantity.hpp @@ -311,6 +311,26 @@ namespace xo { return Quantity::add(x, y); } + /** note: won't have constexpr result until c++26 (when ::sqrt(), ::pow() are constexpr) + **/ + template + requires quantity2_concept + constexpr auto + operator+ (const Quantity & x, double y) + { + return x + Quantity(y, nu::dimensionless); + } + + /** note: won't have constexpr result until c++26 (when ::sqrt(), ::pow() are constexpr) + **/ + template + requires quantity2_concept + constexpr auto + operator+ (double x, const Quantity & y) + { + return Quantity(x, nu::dimensionless) + y; + } + /** note: won't have constexpr result until c++26 (when ::sqrt(), ::pow() are constexpr) **/ template