mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-06 13:44:27 +02:00
feat: quantity_point
converting constructor now takes into account convertibility of the quantity
type
This commit is contained in:
@@ -101,9 +101,10 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
template<QuantityPointOf<point_origin> QP2>
|
||||
requires std::convertible_to<typename QP2::quantity_type, quantity_type>
|
||||
constexpr explicit(false) quantity_point(const QP2& qp) : q_(qp.relative())
|
||||
template<QuantityPointOf<point_origin> QP>
|
||||
requires std::constructible_from<quantity_type, typename QP::quantity_type>
|
||||
constexpr explicit(!std::convertible_to<typename QP::quantity_type, quantity_type>) quantity_point(const QP& qp) :
|
||||
q_(qp.relative())
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user