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