diff --git a/src/core/include/units/quantity.h b/src/core/include/units/quantity.h index c40b9992..03140500 100644 --- a/src/core/include/units/quantity.h +++ b/src/core/include/units/quantity.h @@ -367,11 +367,12 @@ public: } [[nodiscard]] friend constexpr Quantity auto operator%(const quantity& lhs, const quantity& rhs) - requires (!floating_point_) && is_same_v && + requires (!floating_point_) && invoke_result_convertible_to_, rep, rep> { gsl_ExpectsAudit(rhs.number() != quantity_values::zero()); - return units::quantity(lhs.number() % rhs.number()); + using ret = quantity, rep, rep>>; + return ret(lhs.number() % rhs.number()); } [[nodiscard]] friend constexpr auto operator<=>(const quantity& lhs, const quantity& rhs)