File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
src/core/include/mp-units/framework Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -61,15 +61,13 @@ template<Unit UFrom, Unit UTo>
6161 return is_integral (get_canonical_unit (from).mag / get_canonical_unit (to).mag );
6262}
6363
64- template <typename T>
65- concept IsFloatingPoint = treat_as_floating_point<T>;
66-
6764template <typename FromRep, typename ToRep, auto FromUnit, auto ToUnit>
68- concept ValuePreservingTo = Unit<MP_UNITS_REMOVE_CONST(decltype (FromUnit))> &&
69- Unit<MP_UNITS_REMOVE_CONST(decltype (ToUnit))> && std::assignable_from<ToRep&, FromRep> &&
70- (IsFloatingPoint<ToRep> || (!IsFloatingPoint<std::remove_cvref_t <FromRep>> &&
71- integral_conversion_factor (FromUnit, ToUnit) &&
72- !overflows_non_zero_values<ToRep>(FromUnit, ToUnit)));
65+ concept ValuePreservingTo =
66+ Unit<MP_UNITS_REMOVE_CONST(decltype (FromUnit))> && Unit<MP_UNITS_REMOVE_CONST(decltype (ToUnit))> &&
67+ std::assignable_from<ToRep&, FromRep> &&
68+ (treat_as_floating_point<ToRep> ||
69+ (!treat_as_floating_point<std::remove_cvref_t <FromRep>> && integral_conversion_factor(FromUnit, ToUnit) &&
70+ !overflows_non_zero_values<ToRep>(FromUnit, ToUnit)));
7371
7472template <typename FromRep, typename ToRep, auto QS>
7573concept RepresentationValuePreservingTo =
You can’t perform that action at this time.
0 commit comments