mp_units::quantity_point::in

in overloads

Synopses

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

Returns this quantity point re-expressed with another representation type, in the same unit.

template<RepresentationOf<quantity_spec> ToRep>
requires detail::RepConstructibleFrom<ToRep, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in() const;
» more...

Returns this quantity point re-expressed in another unit, implicitly convertible to rep.

template<UnitOf<quantity_spec> ToU>
requires detail::ImplicitScaling<unit, ToU{}, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in(ToU to_u) const;
» more...

Returns this quantity point re-expressed with another representation type, applying an explicit rounding policy.

template<
    RepresentationOf<quantity_spec> ToRep,
    RoundingPolicy Policy>
requires std::constructible_from<ToRep, rep> && detail::ValidRoundingPolicyFor<Policy, rep, ToRep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in(Policy policy) const;
» more...

Returns this quantity point re-expressed in another unit and representation type, both implicitly convertible.

template<
    RepresentationOf<quantity_spec> ToRep,
    UnitOf<quantity_spec> ToU>
requires detail::RepConstructibleFrom<ToRep, rep> && detail::ImplicitConversion<unit, rep, ToU{}, ToRep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in(ToU to_u) const;
» more...

Returns this quantity point re-expressed in another unit, applying an explicit rounding policy.

template<
    UnitOf<quantity_spec> ToU,
    RoundingPolicy Policy>
requires detail::ExplicitlyCastable<unit, ToU{}, rep> && detail::ValidRoundingPolicyFor<Policy, rep, rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in(
    ToU to_u,
    Policy policy) const;
» more...

Returns this quantity point re-expressed in another unit and representation type, applying an explicit rounding policy.

template<
    RepresentationOf<quantity_spec> ToRep,
    UnitOf<quantity_spec> ToU,
    RoundingPolicy Policy>
requires std::constructible_from<ToRep, rep> && detail::ExplicitlyCastable<unit, ToU{}, ToRep> &&
             detail::ValidRoundingPolicyFor<Policy, rep, ToRep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_spec> auto
in(
    ToU to_u,
    Policy policy) const;
» more...

Return Value

  • The equivalent quantity point with representation type ToRep.
  • The equivalent quantity point expressed in to_u.
  • The equivalent quantity point expressed in to_u with representation type ToRep.

NOTE

The return value should not be discarded.

Parameters

NameDescription
to_uthe target unit
policythe rounding policy to apply when the conversion is not exact