Controls whether conversion from quantity<FromUnit, FromRep> to quantity<ToUnit, ToRep> is implicit or explicit.
Synopsis
Declared in <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)));
Description
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.
Template Parameters
| Name | Description |
|---|---|
FromUnit |
the source unit value (NTTP) |
FromRep |
the source representation type |
ToUnit |
the target unit value (NTTP) |
ToRep |
the target representation type |
Created with MrDocs