mp_units::quantity_point::numerical_value_in

numerical_value_in overloads

Synopses

Declared in <mp-units/framework/quantity_point.h>

Returns the numerical value of this quantity point on the scale of another unit, implicitly convertible to rep.

template<UnitOf<quantity_spec> U>
requires (PO == default_point_origin(R)) && detail::ImplicitScaling<unit, U{}, rep>
[[nodiscard]]
constexpr
RepresentationOf<quantity_spec> auto
numerical_value_in(U u) const noexcept;
» more...

Returns the numerical value of this quantity point on the scale of another unit, applying an explicit rounding policy.

template<
    UnitOf<quantity_spec> U,
    RoundingPolicy Policy>
requires (PO == default_point_origin(R)) && detail::ExplicitlyCastable<unit, U{}, rep> &&
            detail::ValidRoundingPolicyFor<Policy, rep, rep>
[[nodiscard]]
constexpr
RepresentationOf<quantity_spec> auto
numerical_value_in(
    U u,
    Policy policy) const noexcept;
» more...

Return Value

  • The numerical value expressed in u.
  • The numerical value expressed in u, measured from the default point origin.

NOTE

The return value should not be discarded.

Parameters

NameDescription
uthe target unit, measured from the default point origin of that unit
policythe rounding policy to apply when the conversion is not exact