diff --git a/src/core/include/mp-units/framework/quantity_point.h b/src/core/include/mp-units/framework/quantity_point.h index c9d9ede4..3b1ee27b 100644 --- a/src/core/include/mp-units/framework/quantity_point.h +++ b/src/core/include/mp-units/framework/quantity_point.h @@ -461,21 +461,36 @@ public: } // binary operators on quantity points +#if defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 17 + template QP, auto R2, typename Rep2> + requires ReferenceOf +#else template QP, ReferenceOf auto R2, typename Rep2> +#endif [[nodiscard]] friend constexpr QuantityPoint auto operator+(const QP& qp, const quantity& q) requires requires { qp.quantity_ref_from(PO) + q; } { return detail::make_quantity_point(qp.quantity_ref_from(PO) + q, PO); } +#if defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 17 + template QP> + requires ReferenceOf +#else template auto R1, typename Rep1, std::derived_from QP> +#endif [[nodiscard]] friend constexpr QuantityPoint auto operator+(const quantity& q, const QP& qp) requires requires { q + qp.quantity_ref_from(PO); } { return qp + q; } +#if defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 17 + template QP, auto R2, typename Rep2> + requires ReferenceOf +#else template QP, ReferenceOf auto R2, typename Rep2> +#endif [[nodiscard]] friend constexpr QuantityPoint auto operator-(const QP& qp, const quantity& q) requires requires { qp.quantity_ref_from(PO) - q; } {