From 978ce4093a65a953fc3706d8e6ef000143a6c10a Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 16 May 2023 14:08:36 +0200 Subject: [PATCH] feat: `quantity_point` converting constructor now takes into account convertibility of the `quantity` type --- src/core/include/mp_units/quantity_point.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/include/mp_units/quantity_point.h b/src/core/include/mp_units/quantity_point.h index a94351ad..59c574c6 100644 --- a/src/core/include/mp_units/quantity_point.h +++ b/src/core/include/mp_units/quantity_point.h @@ -101,9 +101,10 @@ public: { } - template QP2> - requires std::convertible_to - constexpr explicit(false) quantity_point(const QP2& qp) : q_(qp.relative()) + template QP> + requires std::constructible_from + constexpr explicit(!std::convertible_to) quantity_point(const QP& qp) : + q_(qp.relative()) { }