diff --git a/src/core/include/mp-units/framework/quantity_point.h b/src/core/include/mp-units/framework/quantity_point.h index aadca963..a99d230b 100644 --- a/src/core/include/mp-units/framework/quantity_point.h +++ b/src/core/include/mp-units/framework/quantity_point.h @@ -431,17 +431,19 @@ public: } // compound assignment operators - template QP> - requires requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ += q; } - friend constexpr decltype(auto) operator+=(QP&& qp, const quantity_type& q) + template QP, auto R2, typename Rep2> + requires detail::QuantityConvertibleTo, quantity_type> && + requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ += q; } + friend constexpr decltype(auto) operator+=(QP&& qp, const quantity& q) { qp.quantity_from_origin_is_an_implementation_detail_ += q; return std::forward(qp); } - template QP> - requires requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ -= q; } - friend constexpr decltype(auto) operator-=(QP&& qp, const quantity_type& q) + template QP, auto R2, typename Rep2> + requires detail::QuantityConvertibleTo, quantity_type> && + requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ -= q; } + friend constexpr decltype(auto) operator-=(QP&& qp, const quantity& q) { qp.quantity_from_origin_is_an_implementation_detail_ -= q; return std::forward(qp);