fix: quantity_cast fixed

This commit is contained in:
Mateusz Pusz
2023-02-13 18:17:41 +01:00
parent 195f9c13b9
commit a37df7504b

View File

@@ -56,7 +56,7 @@ class quantity;
* @tparam ToQS a quantity specification to use for a target quantity * @tparam ToQS a quantity specification to use for a target quantity
*/ */
template<QuantitySpec auto ToQS, typename Q> template<QuantitySpec auto ToQS, typename Q>
requires Quantity<std::remove_cvref_t<Q>> && castable_to(get_quantity_spec(Q::reference), ToQS) requires Quantity<std::remove_cvref_t<Q>> && (castable_to(std::remove_cvref_t<Q>::quantity_spec, ToQS))
[[nodiscard]] constexpr Quantity auto quantity_cast(Q&& q) [[nodiscard]] constexpr Quantity auto quantity_cast(Q&& q)
{ {
constexpr reference<ToQS, std::remove_cvref_t<Q>::unit> r; constexpr reference<ToQS, std::remove_cvref_t<Q>::unit> r;