From 698b6ce3383472949b3daac62a9fea2f16f018fe Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Thu, 15 Jun 2023 17:39:33 +0300 Subject: [PATCH] refactor: `sudo_cast` `if constexpr` condition refactored --- src/core/include/mp-units/bits/sudo_cast.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/include/mp-units/bits/sudo_cast.h b/src/core/include/mp-units/bits/sudo_cast.h index c60c6476..04546df4 100644 --- a/src/core/include/mp-units/bits/sudo_cast.h +++ b/src/core/include/mp-units/bits/sudo_cast.h @@ -59,7 +59,7 @@ template // TODO how to constrain the second part here? [[nodiscard]] constexpr Quantity auto sudo_cast(From&& q) { - if constexpr (q.unit == To::unit) { + if constexpr (std::remove_reference_t::unit == To::unit) { // no scaling of the number needed return make_quantity( static_cast(std::forward(q).number())); // this is the only (and recommended) way to do