diff --git a/include/xo/unit/xquantity.hpp b/include/xo/unit/xquantity.hpp index 3aec78c2..c03de0ec 100644 --- a/include/xo/unit/xquantity.hpp +++ b/include/xo/unit/xquantity.hpp @@ -371,6 +371,26 @@ namespace xo { return (Quantity::compare(x, y) == 0); } + /** 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