diff --git a/src/core/include/mp-units/bits/quantity_cast.h b/src/core/include/mp-units/bits/quantity_cast.h index cf8fbef9e..04228a3b8 100644 --- a/src/core/include/mp-units/bits/quantity_cast.h +++ b/src/core/include/mp-units/bits/quantity_cast.h @@ -50,11 +50,7 @@ template requires Quantity> && (castable(Q::quantity_spec, ToQS)) [[nodiscard]] constexpr Quantity auto quantity_cast(Q&& q) { - if constexpr (detail::QuantityKindSpec> && - AssociatedUnit>) - return quantity{std::forward(q).numerical_value_is_an_implementation_detail_, Q::unit}; - else - return quantity{std::forward(q).numerical_value_is_an_implementation_detail_, reference{}}; + return quantity{std::forward(q).numerical_value_is_an_implementation_detail_, make_reference(ToQS, Q::unit)}; } /**