mp_units::value_cast¶
Synopsis¶
Declared in <mp-units/framework/value_cast.h>
template<typename ToRep, Unit auto ToU, typename FwdQP,
/* implementation-defined */ Policy = truncated_t,
QuantityPoint QP = std::remove_cvref_t<FwdQP>>
requires UnitOf<decltype(ToU), QP::quantity_spec> &&
RepresentationOf<ToRep, QP::quantity_spec> &&
std::constructible_from<ToRep, typename QP::rep> &&
detail::UnitChangeCastable<QP::unit, ToU, ToRep> &&
detail::ValidRoundingPolicyFor<Policy, typename QP::rep, ToRep>
[[nodiscard]] constexpr QuantityPoint auto value_cast(FwdQP&& qp,
Policy policy = Policy{});
Return Value¶
Note
The return value should not be discarded.