Skip to content

Commit

Permalink
[msvc][fix] add Todo comment for bug
Browse files Browse the repository at this point in the history
  • Loading branch information
czjhoppe committed Sep 10, 2024
1 parent 4f4da58 commit 5ecb6c2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/include/mp-units/framework/quantity.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ class quantity {
}
friend constexpr decltype(auto) operator*=(FwdQ&& lhs, const Value& v)
{
// TODO use *= when compiiler bug is resolved:
// https://developercommunity.visualstudio.com/t/Discrepancy-in-Behavior-of-operator-an/10732445
lhs.numerical_value_is_an_implementation_detail_ = lhs.numerical_value_is_an_implementation_detail_ * v;
return std::forward<FwdQ>(lhs);
}
Expand All @@ -447,6 +449,8 @@ class quantity {
}
friend constexpr decltype(auto) operator*=(FwdQ1&& lhs, const Q2& rhs)
{
// TODO use *= when compiiler bug is resolved:
// https://developercommunity.visualstudio.com/t/Discrepancy-in-Behavior-of-operator-an/10732445
lhs.numerical_value_is_an_implementation_detail_ =
lhs.numerical_value_is_an_implementation_detail_ * rhs.numerical_value_is_an_implementation_detail_;
return std::forward<FwdQ1>(lhs);
Expand All @@ -461,6 +465,8 @@ class quantity {
friend constexpr decltype(auto) operator/=(FwdQ&& lhs, const Value& v)
{
MP_UNITS_EXPECTS_DEBUG(v != quantity_values<Value>::zero());
// TODO use /= when compiiler bug is resolved:
// https://developercommunity.visualstudio.com/t/Discrepancy-in-Behavior-of-operator-an/10732445
lhs.numerical_value_is_an_implementation_detail_ = lhs.numerical_value_is_an_implementation_detail_ / v;
return std::forward<FwdQ>(lhs);
}
Expand All @@ -474,6 +480,8 @@ class quantity {
friend constexpr decltype(auto) operator/=(FwdQ1&& lhs, const Q2& rhs)
{
MP_UNITS_EXPECTS_DEBUG(rhs != rhs.zero());
// TODO use /= when compiiler bug is resolved:
// https://developercommunity.visualstudio.com/t/Discrepancy-in-Behavior-of-operator-an/10732445
lhs.numerical_value_is_an_implementation_detail_ =
lhs.numerical_value_is_an_implementation_detail_ / rhs.numerical_value_is_an_implementation_detail_;
return std::forward<FwdQ1>(lhs);
Expand Down

0 comments on commit 5ecb6c2

Please sign in to comment.