diff --git a/src/core/include/mp-units/quantity_point.h b/src/core/include/mp-units/quantity_point.h index 535a16e0..925c183a 100644 --- a/src/core/include/mp-units/quantity_point.h +++ b/src/core/include/mp-units/quantity_point.h @@ -112,18 +112,20 @@ public: { } - template - requires std::constructible_from> - constexpr explicit(!std::convertible_to, quantity_type>) - quantity_point(const quantity_point& qp) : - q_(qp.relative()) - { - } - template QP> requires std::constructible_from constexpr explicit(!std::convertible_to) quantity_point(const QP& qp) : - q_(qp.absolute() - zero().absolute()) + q_([&] { + if constexpr (std::is_same_v, + std::remove_const_t>) { + return qp.relative(); + } else if constexpr (detail::is_derived_from_specialization_of_relative_point_origin< + std::remove_const_t>) { + return qp.absolute() - zero().absolute(); + } else { + return qp.absolute(); + } + }()) { }