diff --git a/src/core/include/mp-units/quantity.h b/src/core/include/mp-units/quantity.h index ccf8b80b..674f44c7 100644 --- a/src/core/include/mp-units/quantity.h +++ b/src/core/include/mp-units/quantity.h @@ -262,7 +262,7 @@ public: } -> std::same_as; } { - gsl_ExpectsAudit(q.numerical_value() != quantity_values::zero()); + gsl_ExpectsAudit(q != zero()); value_ %= q.numerical_value(); return *this; } @@ -312,7 +312,7 @@ public: } constexpr quantity& operator/=(const Q& rhs) { - gsl_ExpectsAudit(rhs.numerical_value() != quantity_values::zero()); + gsl_ExpectsAudit(rhs != rhs.zero()); value_ /= rhs.numerical_value(); return *this; } @@ -358,7 +358,7 @@ template detail::InvocableQuantities, quantity, quantity> [[nodiscard]] constexpr Quantity auto operator%(const quantity& lhs, const quantity& rhs) { - gsl_ExpectsAudit(rhs.numerical_value() != quantity_values::zero()); + gsl_ExpectsAudit(rhs != rhs.zero()); using ret = detail::common_quantity_for, quantity, quantity>; return make_quantity(ret(lhs).numerical_value() % ret(rhs).numerical_value()); } @@ -391,7 +391,7 @@ template requires detail::InvokeResultOf<(get_quantity_spec(R1) / get_quantity_spec(R2)).character, std::divides<>, Rep1, Rep2> [[nodiscard]] constexpr Quantity auto operator/(const quantity& lhs, const quantity& rhs) { - gsl_ExpectsAudit(rhs.numerical_value() != quantity_values::zero()); + gsl_ExpectsAudit(rhs != rhs.zero()); return make_quantity(lhs.numerical_value() / rhs.numerical_value()); }