[#mp_units-quantity_cast-0f] = xref:mp_units.adoc[mp_units]::quantity_cast :relfileprefix: ../ :mrdocs: `quantity_cast` overloads == Synopses Declared in `<mp‐units/framework/quantity_cast.h>` Explicit cast of a quantity type [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/QuantitySpec.adoc[QuantitySpec] auto ToQS, typename FwdQ, xref:mp_units/Quantity.adoc[Quantity] Q = std::remove_cvref_t<FwdQ>> requires (mp_units::castable(Q::quantity_spec, ToQS)) && requires { typename quantity<make_reference(ToQS, Q::unit), typename Q::rep>; } [[nodiscard]] constexpr xref:mp_units/Quantity.adoc[Quantity] auto xref:mp_units/quantity_cast-06.adoc[quantity_cast](FwdQ&& q); ---- [.small]#xref:mp_units/quantity_cast-06.adoc[_» more..._]# Explicit cast of a quantity point type [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/QuantitySpec.adoc[QuantitySpec] auto ToQS, typename FwdQP, xref:mp_units/QuantityPoint.adoc[QuantityPoint] QP = std::remove_cvref_t<FwdQP>> requires (mp_units::castable(QP::quantity_spec, ToQS)) && requires { typename quantity_point<make_reference(ToQS, QP::unit), QP::point_origin, typename QP::rep>; } [[nodiscard]] constexpr xref:mp_units/QuantityPoint.adoc[QuantityPoint] auto xref:mp_units/quantity_cast-05.adoc[quantity_cast](FwdQP&& qp); ---- [.small]#xref:mp_units/quantity_cast-05.adoc[_» more..._]# == Template Parameters [cols="1,4"] |=== |Name|Description | *ToQS* | a quantity specification to use for a target quantity |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#