diff --git a/include/xo/unit/Quantity.hpp b/include/xo/unit/Quantity.hpp index 604664b2..8f02c32f 100644 --- a/include/xo/unit/Quantity.hpp +++ b/include/xo/unit/Quantity.hpp @@ -242,8 +242,7 @@ namespace xo { return Quantity::divide(x, y); } - /** note: won't have constexpr result until c++26 (when ::sqrt(), ::pow() are constexpr) - **/ + /** note: doesn not require unit scaling, so constexpr with c++23 **/ template requires quantity2_concept && std::is_arithmetic_v constexpr auto @@ -252,6 +251,15 @@ namespace xo { return x.divide_by(y); } + /** note: doesn 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.divide_into(x); + } + /** note: won't have constexpr result until c++26 (when ::sqrt(), ::pow() are constexpr) **/ template