mp_units::quantity::force_in

Deprecated. Returns this quantity re-expressed in another unit and representation type, truncating if inexact.

Synopsis

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

template<
    RepresentationOf<quantity_spec> ToRep,
    UnitOf<quantity_spec> ToU>
requires std::constructible_from<ToRep, rep> && detail::ExplicitlyCastable<unit, ToU{}, rep>
[[deprecated("2.6.0: use `in<Rep>(unit, policy)` with a rounding policy (e.g. `truncated`) instead"), nodiscard]]
constexpr
QuantityOf<quantity_spec> auto
force_in(ToU to_u) const;

WARNING

Deprecated: 2.6.0: use `in<Rep>(unit, policy)` with a rounding policy (e.g. `truncated`) instead. Use of this entity is allowed but discouraged.

Return Value

The equivalent quantity expressed in to_u with representation type ToRep.

NOTE

The return value should not be discarded.

Parameters

NameDescription
to_uthe target unit