mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 04:44:27 +02:00
feat: missing precondition added for quantity::op/
This commit is contained in:
@@ -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};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user