5 Quantities and units library [quantities]

5.7 Quantity point [qty.pt]

5.7.15 Non-member conversions [qty.pt.non.mem.conv]

template<QuantityPoint ToQP, typename FwdFromQP, QuantityPoint FromQP = std::remove_cvref_t<FwdFromQP>> requires see below constexpr QuantityPoint auto sudo-cast(FwdFromQP&& qp);
Returns: TBD.
value_cast is an explicit cast that allows truncation.
template<Unit auto ToU, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> requires(convertible(QP::reference, ToU)) constexpr QuantityPoint auto value_cast(FwdQP&& qp);
Effects: Equivalent to: return quantity_point{value_cast<ToU>(std::forward<FwdQP>(qp).quantity-from-origin), QP::point_origin};
template<Representation ToRep, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> requires RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep> constexpr quantity_point<QP::reference, QP::point_origin, ToRep> value_cast(FwdQP&& qp);
Effects: Equivalent to: return {value_cast<ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), QP::point_origin};
template<Unit auto ToU, Representation ToRep, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> requires see below constexpr QuantityPoint auto value_cast(FwdQP&& qp); template<Representation ToRep, Unit auto ToU, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> requires see below constexpr QuantityPoint auto value_cast(FwdQP&& qp);
Effects: Equivalent to: return quantity_point{value_cast<ToU, ToRep>(std::forward<FwdQP>(qp).quantity-from-origin), QP::point_origin};
Remarks: The expression in the requires-clause is equivalent to: (convertible(QP::reference, ToU)) && RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep>
template<Quantity ToQ, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> requires(convertible(QP::reference, ToQ::unit)) && (ToQ::quantity_spec == QP::quantity_spec) && std::constructible_from<typename ToQ::rep, typename QP::rep> constexpr QuantityPoint auto value_cast(FwdQP&& qp);
Effects: Equivalent to: return quantity_point{value_cast<ToQ>(std::forward<FwdQP>(qp).quantity-from-origin), QP::point_origin};
template<QuantityPoint ToQP, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> requires(convertible(QP::reference, ToQP::unit)) && (ToQP::quantity_spec == QP::quantity_spec) && (same-absolute-point-origins(ToQP::point_origin, QP::point_origin)) && std::constructible_from<typename ToQP::rep, typename QP::rep> constexpr QuantityPoint auto value_cast(FwdQP&& qp);
Effects: Equivalent to: return sudo-cast<ToQP>(std​::​forward<FwdQP>(qp));
quantity_cast is an explicit cast that allows converting to more specific quantities.
template<QuantitySpec auto ToQS, typename FwdQP, QuantityPoint QP = std::remove_cvref_t<FwdQP>> requires QuantitySpecCastableTo<QP::quantity_spec, ToQS> constexpr QuantityPoint auto quantity_cast(FwdQP&& qp);
Effects: Equivalent to: return QP{quantity_cast<ToQS>(std::forward<FwdQP>(qp).quantity_from_origin), QP::point_origin};