[#mp_units-value_cast-03d] = xref:mp_units.adoc[mp_units]::value_cast :relfileprefix: ../ :mrdocs: `value_cast` overloads == Synopses Declared in `<mp‐units/framework/value_cast.h>` Explicit cast of a quantity's representation [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Quantity.adoc[Quantity] ToQ, typename FwdQ, xref:mp_units/Quantity.adoc[Quantity] Q = std::remove_cvref_t<FwdQ>> requires (ToQ::quantity_spec == Q::quantity_spec) && (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(ToQ::unit), Q::quantity_spec)) && std::constructible_from<typename ToQ::rep, typename Q::rep> && detail::SaneScaling<Q::unit, ToQ::unit, typename ToQ::rep> [[nodiscard]] constexpr xref:mp_units/Quantity.adoc[Quantity] auto xref:mp_units/value_cast-0a.adoc[value_cast](FwdQ&& q); ---- [.small]#xref:mp_units/value_cast-0a.adoc[_» more..._]# Explicit cast of a quantity's representation type [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename ToRep, typename FwdQ, xref:mp_units/Quantity.adoc[Quantity] Q = std::remove_cvref_t<FwdQ>> requires RepresentationOf<ToRep, Q::quantity_spec> && std::constructible_from<ToRep, typename Q::rep> [[nodiscard]] constexpr xref:mp_units/quantity-01.adoc[quantity<Q::reference, ToRep>] xref:mp_units/value_cast-028.adoc[value_cast](FwdQ&& q); ---- [.small]#xref:mp_units/value_cast-028.adoc[_» more..._]# Explicit cast of a quantity's unit [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< auto ToU, typename FwdQ, xref:mp_units/Quantity.adoc[Quantity] Q = std::remove_cvref_t<FwdQ>> requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), Q::quantity_spec)) && detail::SaneScaling<Q::unit, ToU, typename Q::rep> [[nodiscard]] constexpr xref:mp_units/Quantity.adoc[Quantity] auto xref:mp_units/value_cast-04.adoc[value_cast](FwdQ&& q); ---- [.small]#xref:mp_units/value_cast-04.adoc[_» more..._]# Explicit cast of a quantity point's representation [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Quantity.adoc[Quantity] ToQ, typename FwdQP, xref:mp_units/QuantityPoint.adoc[QuantityPoint] QP = std::remove_cvref_t<FwdQP>> requires (ToQ::quantity_spec == QP::quantity_spec) && (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(ToQ::unit), QP::quantity_spec)) && std::constructible_from<typename ToQ::rep, typename QP::rep> && detail::SaneScaling<QP::unit, ToQ::unit, typename ToQ::rep> [[nodiscard]] constexpr xref:mp_units/QuantityPoint.adoc[QuantityPoint] auto xref:mp_units/value_cast-035.adoc[value_cast](FwdQP&& qp); ---- [.small]#xref:mp_units/value_cast-035.adoc[_» more..._]# Explicit cast of a quantity point's representation, including potentially the point origin [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/QuantityPoint.adoc[QuantityPoint] ToQP, typename FwdQP, xref:mp_units/QuantityPoint.adoc[QuantityPoint] QP = std::remove_cvref_t<FwdQP>> requires (ToQP::quantity_spec == QP::quantity_spec) && (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_NONCONST_TYPE(ToQP::unit), QP::quantity_spec)) && (detail::same_absolute_point_origins(ToQP::point_origin, QP::point_origin)) && std::constructible_from<typename ToQP::rep, typename QP::rep> && detail::SaneScaling<QP::unit, ToQP::unit, typename ToQP::rep> [[nodiscard]] constexpr xref:mp_units/QuantityPoint.adoc[QuantityPoint] auto xref:mp_units/value_cast-0c.adoc[value_cast](FwdQP&& qp); ---- [.small]#xref:mp_units/value_cast-0c.adoc[_» more..._]# Explicit cast of a quantity point's representation type [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename ToRep, typename FwdQP, xref:mp_units/QuantityPoint.adoc[QuantityPoint] QP = std::remove_cvref_t<FwdQP>> requires RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep> [[nodiscard]] constexpr xref:mp_units/quantity_point-08.adoc[quantity_point<QP::reference, QP::point_origin, ToRep>] xref:mp_units/value_cast-021.adoc[value_cast](FwdQP&& qp); ---- [.small]#xref:mp_units/value_cast-021.adoc[_» more..._]# Explicit cast of a quantity point's unit [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Unit.adoc[Unit] auto ToU, typename FwdQP, xref:mp_units/QuantityPoint.adoc[QuantityPoint] QP = std::remove_cvref_t<FwdQP>> requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), QP::quantity_spec)) && detail::SaneScaling<QP::unit, ToU, typename QP::rep> [[nodiscard]] constexpr xref:mp_units/QuantityPoint.adoc[QuantityPoint] auto xref:mp_units/value_cast-027.adoc[value_cast](FwdQP&& qp); ---- [.small]#xref:mp_units/value_cast-027.adoc[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename ToRep, xref:mp_units/Unit.adoc[Unit] auto ToU, typename FwdQ, xref:mp_units/Quantity.adoc[Quantity] Q = std::remove_cvref_t<FwdQ>> requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), Q::quantity_spec)) && RepresentationOf<ToRep, Q::quantity_spec> && std::constructible_from<ToRep, typename Q::rep> && detail::SaneScaling<Q::unit, ToU, ToRep> [[nodiscard]] constexpr xref:mp_units/Quantity.adoc[Quantity] auto xref:mp_units/value_cast-01.adoc[value_cast](FwdQ&& q); ---- [.small]#xref:mp_units/value_cast-01.adoc[_» more..._]# Explicit cast of a quantity's unit and representation type [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Unit.adoc[Unit] auto ToU, typename ToRep, typename FwdQ, xref:mp_units/Quantity.adoc[Quantity] Q = std::remove_cvref_t<FwdQ>> requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), Q::quantity_spec)) && RepresentationOf<ToRep, Q::quantity_spec> && std::constructible_from<ToRep, typename Q::rep> && detail::SaneScaling<Q::unit, ToU, ToRep> [[nodiscard]] constexpr xref:mp_units/Quantity.adoc[Quantity] auto xref:mp_units/value_cast-02e.adoc[value_cast](FwdQ&& q); ---- [.small]#xref:mp_units/value_cast-02e.adoc[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename ToRep, xref:mp_units/Unit.adoc[Unit] auto ToU, typename FwdQP, xref:mp_units/QuantityPoint.adoc[QuantityPoint] QP = std::remove_cvref_t<FwdQP>> requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), QP::quantity_spec)) && RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep> && detail::SaneScaling<QP::unit, ToU, ToRep> [[nodiscard]] constexpr xref:mp_units/QuantityPoint.adoc[QuantityPoint] auto xref:mp_units/value_cast-05.adoc[value_cast](FwdQP&& qp); ---- [.small]#xref:mp_units/value_cast-05.adoc[_» more..._]# Explicit cast of a quantity point's unit and representation type [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Unit.adoc[Unit] auto ToU, typename ToRep, typename FwdQP, xref:mp_units/QuantityPoint.adoc[QuantityPoint] QP = std::remove_cvref_t<FwdQP>> requires (MP_UNITS_WEAK_UNIT_OF(MP_UNITS_REMOVE_CONST(decltype(ToU)), QP::quantity_spec)) && RepresentationOf<ToRep, QP::quantity_spec> && std::constructible_from<ToRep, typename QP::rep> && detail::SaneScaling<QP::unit, ToU, ToRep> [[nodiscard]] constexpr xref:mp_units/QuantityPoint.adoc[QuantityPoint] auto xref:mp_units/value_cast-0d.adoc[value_cast](FwdQP&& qp); ---- [.small]#xref:mp_units/value_cast-0d.adoc[_» more..._]# == Template Parameters [cols=2] |=== | Name | Description | *ToQ* | a target quantity type to which to cast the representation | *ToRep* | a representation type to use for a target quantity | *ToU* | a unit to use for a target quantity | *ToQP* | a target quantity point type to which to cast the representation of the point |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#