From bd9e4f944c9cfbaeb57493940d22b429b7fec80a Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Mon, 18 Dec 2023 15:40:25 +0100 Subject: [PATCH] fix: `QuantityLike` conversions required `Q::rep` instead of using one provided by `quantity_like_traits` --- src/core/include/mp-units/quantity.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/include/mp-units/quantity.h b/src/core/include/mp-units/quantity.h index b5f2e7d9c..28dddb911 100644 --- a/src/core/include/mp-units/quantity.h +++ b/src/core/include/mp-units/quantity.h @@ -158,7 +158,7 @@ class quantity { quantity::reference, typename quantity_like_traits::rep>, quantity> constexpr explicit(is_specialization_of::to_numerical_value(std::declval())), convert_explicitly> || - !std::convertible_to) quantity(const Q& q) : + !std::convertible_to::rep, Rep>) quantity(const Q& q) : quantity( ::mp_units::quantity{quantity_like_traits::to_numerical_value(q).value, quantity_like_traits::reference}) { @@ -222,7 +222,7 @@ class quantity { [[nodiscard]] explicit(is_specialization_of::from_numerical_value( numerical_value_is_an_implementation_detail_)), convert_explicitly> || - !std::convertible_to) constexpr + !std::convertible_to::rep>) constexpr operator Q_() const& noexcept( noexcept(quantity_like_traits::from_numerical_value(numerical_value_is_an_implementation_detail_)) && std::is_nothrow_copy_constructible_v) @@ -236,7 +236,7 @@ class quantity { [[nodiscard]] explicit(is_specialization_of::from_numerical_value( numerical_value_is_an_implementation_detail_)), convert_explicitly> || - !std::convertible_to) constexpr + !std::convertible_to::rep>) constexpr operator Q_() && noexcept( noexcept(quantity_like_traits::from_numerical_value(numerical_value_is_an_implementation_detail_)) && std::is_nothrow_move_constructible_v)