feat: quantity_point can now be constructed faster from another one if they share the same point_origin

This commit is contained in:
Mateusz Pusz
2023-07-07 09:36:08 +02:00
parent 7b47b2fe57
commit 9e42e1faca

View File

@@ -112,6 +112,14 @@ public:
{
}
template<auto R2, typename Rep2>
requires std::constructible_from<quantity_type, quantity<R2, Rep2>>
constexpr explicit(!std::convertible_to<quantity<R2, Rep2>, quantity_type>)
quantity_point(const quantity_point<R2, point_origin, Rep2>& qp) :
q_(qp.relative())
{
}
template<QuantityPointOf<absolute_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) :