Controls whether conversion from quantity<FromUnit, FromRep> to quantity<ToUnit, ToRep> is implicit or explicit.
<mp-units/framework/value_cast.h>template<
auto FromUnit,
typename FromRep,
auto ToUnit,
typename ToRep>
constexpr bool implicitly_scalable = std::is_convertible_v<FromRep, ToRep> &&
(treat_as_floating_point<ToRep> || (!treat_as_floating_point<FromRep> && is_integral_scaling(FromUnit, ToUnit)));
The default is true iff FromRep is convertible to ToRep and the scaling is non-truncating: either ToRep is floating-point, or both reps are non-floating-point and the unit magnitude ratio is an integral factor.
Specialize this variable template to customize the implicit/explicit decision for your own representation types.
| Name | Description |
|---|---|
| FromUnit | the source unit value (NTTP) |
| FromRep | the source representation type |
| ToUnit | the target unit value (NTTP) |
| ToRep | the target representation type |