diff --git a/src/core/include/mp-units/framework/customization_points.h b/src/core/include/mp-units/framework/customization_points.h index 430f7b9e..23bf4be7 100644 --- a/src/core/include/mp-units/framework/customization_points.h +++ b/src/core/include/mp-units/framework/customization_points.h @@ -60,6 +60,19 @@ constexpr bool treat_as_floating_point = std::is_floating_point_v>; #endif +/** + * @brief Specifies if a specific conversion between two types preserves the value + * + * This type trait should be specialized for a custom representation types to specify + * weather the conversion from the source type to the destination type preserves the value + * or not. Value-truncating conversions should be forced by the user with explicit casts. + * + * @tparam From a source representation type + * @tparam To a destination representation type + */ +template +constexpr bool is_value_preserving = treat_as_floating_point || !treat_as_floating_point; + template [[deprecated("2.5.0: `is_scalar` is no longer necessary and can simply be removed")]] constexpr bool is_scalar = false;