Returns true if the scaling factor from from to to is an exact positive integer.
<mp-units/framework/value_cast.h>[[nodiscard]]
consteval
bool
is_integral_scaling(
auto from,
auto to);
This is the key predicate used by the default implicitly_scalable to decide whether conversions between integer-like representation types are non-truncating (and therefore may be implicit). For example, m → mm has an integral factor (×1000), so integer conversions in that direction are implicit; mm → m has a fractional factor (÷1000), so they are explicit.
| Name | Description |
|---|---|
| from | source unit |
| to | target unit |