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

Synopsis

Declared in <mp‐units/framework/quantity.h>

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

Return Value

The equivalent quantity with representation type ToRep.

Note

The return value should not be discarded.

Parameters

Name

Description

policy

the rounding policy to apply when the conversion is not exact

Created with MrDocs