From 5ecb6c295a17f27cf017f3fe99b900b4648b9199 Mon Sep 17 00:00:00 2001 From: Jonas Hoppe <162709928+czjhoppe@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:01:15 +0200 Subject: [PATCH] [msvc][fix] add Todo comment for bug https://developercommunity.visualstudio.com/t/Discrepancy-in-Behavior-of-operator-an/10732445 --- src/core/include/mp-units/framework/quantity.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/include/mp-units/framework/quantity.h b/src/core/include/mp-units/framework/quantity.h index b2280ef01..18490e072 100644 --- a/src/core/include/mp-units/framework/quantity.h +++ b/src/core/include/mp-units/framework/quantity.h @@ -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(lhs); } @@ -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(lhs); @@ -461,6 +465,8 @@ class quantity { friend constexpr decltype(auto) operator/=(FwdQ&& lhs, const Value& v) { MP_UNITS_EXPECTS_DEBUG(v != quantity_values::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(lhs); } @@ -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(lhs);