[msvc][fix] msvc compiler has different behaviour for *= and * at compile time (issue reported)

This commit is contained in:
Jonas Hoppe
2024-08-30 11:47:11 +02:00
parent 33837c5042
commit aa26488b60

View File

@@ -448,7 +448,7 @@ public:
}
friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& v)
{
lhs.numerical_value_is_an_implementation_detail_ *= v;
lhs.numerical_value_is_an_implementation_detail_ = lhs.numerical_value_is_an_implementation_detail_ * v;
return std::forward<Q>(lhs);
}
@@ -461,7 +461,8 @@ public:
}
friend constexpr decltype(auto) operator*=(Q1&& lhs, const Q2& rhs)
{
lhs.numerical_value_is_an_implementation_detail_ *= rhs.numerical_value_is_an_implementation_detail_;
lhs.numerical_value_is_an_implementation_detail_ = lhs.numerical_value_is_an_implementation_detail_ *
rhs.numerical_value_is_an_implementation_detail_;
return std::forward<Q1>(lhs);
}
@@ -475,7 +476,7 @@ public:
friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& v)
{
MP_UNITS_EXPECTS_DEBUG(v != quantity_values<Value>::zero());
lhs.numerical_value_is_an_implementation_detail_ /= v;
lhs.numerical_value_is_an_implementation_detail_ = lhs.numerical_value_is_an_implementation_detail_ / v;
return std::forward<Q>(lhs);
}
@@ -489,7 +490,8 @@ public:
friend constexpr decltype(auto) operator/=(Q1&& lhs, const Q2& rhs)
{
MP_UNITS_EXPECTS_DEBUG(rhs != rhs.zero());
lhs.numerical_value_is_an_implementation_detail_ /= rhs.numerical_value_is_an_implementation_detail_;
lhs.numerical_value_is_an_implementation_detail_ = lhs.numerical_value_is_an_implementation_detail_
/ rhs.numerical_value_is_an_implementation_detail_;
return std::forward<Q1>(lhs);
}