feat: missing precondition added for quantity::op/

This commit is contained in:
Mateusz Pusz
2024-12-04 20:10:47 +01:00
parent 29ba8e6f7c
commit b98c640450

View File

@@ -585,6 +585,7 @@ public:
(!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep> (!Reference<Value>) && detail::InvokeResultOf<quantity_spec, std::divides<>, const Value&, Rep>
[[nodiscard]] friend constexpr Quantity auto operator/(const Value& val, const Q& q) [[nodiscard]] friend constexpr Quantity auto operator/(const Value& val, const Q& q)
{ {
MP_UNITS_EXPECTS_DEBUG(is_neq_zero(q));
return ::mp_units::quantity{val / q.numerical_value_ref_in(unit), ::mp_units::one / R}; return ::mp_units::quantity{val / q.numerical_value_ref_in(unit), ::mp_units::one / R};
} }