From 136af48e70fada3e845d98c7078826ebaee21dfe Mon Sep 17 00:00:00 2001 From: TheCoconutChef Date: Thu, 20 Oct 2022 12:00:18 -0400 Subject: [PATCH] fix: constraint recursion for gcc11 on operator/ A similar fix was applied in 417f84258523d2e5f868cf080b7b837328edd501 for the operator*. Following discussion in https://github.com/mpusz/units/issues/398, it seems appropriate to apply it for operator/. Other operators (+, -, %) do not seem to suffer from the same problem. --- src/core/include/units/quantity.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/include/units/quantity.h b/src/core/include/units/quantity.h index 84c6042e..5ae8b111 100644 --- a/src/core/include/units/quantity.h +++ b/src/core/include/units/quantity.h @@ -392,8 +392,8 @@ public: return ret(v * q.number()); } - template - requires(!Quantity) && (invoke_result_convertible_to_, rep, const Value&>) + template + requires(invoke_result_convertible_to_, rep, const Value&>) [[nodiscard]] friend constexpr Quantity auto operator/(const quantity& q, const Value& v) { gsl_ExpectsAudit(v != quantity_values::zero()); @@ -401,8 +401,8 @@ public: return ret(q.number() / v); } - template - requires(!Quantity) && (invoke_result_convertible_to_, const Value&, rep>) + template + requires(invoke_result_convertible_to_, const Value&, rep>) [[nodiscard]] friend constexpr Quantity auto operator/(const Value& v, const quantity& q) { return detail::make_quantity<::units::reference{} / reference>(v / q.number());