@@ -77,14 +77,14 @@ template<typename T, typename Arg>
7777concept ValuePreservingAssignment = std::assignable_from<T&, Arg> && is_value_preserving<std::remove_cvref_t <Arg>, T>;
7878
7979template <auto FromUnit, auto ToUnit, typename Rep>
80- concept ValuePreservingScaling1Rep =
80+ concept ValuePreservingScaling =
8181 SaneScaling<FromUnit, ToUnit, Rep> &&
8282 (treat_as_floating_point<Rep> || (integral_conversion_factor(FromUnit, ToUnit)) ||
8383 unsatisfied<" Scaling from '{}' to '{}' is not value-preserving for '{}' representation type" >(
8484 unit_symbol (FromUnit), unit_symbol(ToUnit), type_name<Rep>()));
8585
8686template <auto FromUnit, typename FromRep, auto ToUnit, typename ToRep>
87- concept ValuePreservingScaling2Reps =
87+ concept ValuePreservingConversion =
8888 // TODO consider providing constraints of sudo_cast to check if representation types can be scaled between each other
8989 // CastableReps<FromRep, ToRep, FromUnit, ToUnit> &&
9090 SaneScaling<FromUnit, ToUnit, ToRep> &&
@@ -97,7 +97,7 @@ template<typename QTo, typename QFrom>
9797concept QuantityConstructibleFrom =
9898 Quantity<QTo> && Quantity<QFrom> && explicitly_convertible(QFrom::quantity_spec, QTo::quantity_spec) &&
9999 ValuePreservingConstruction<typename QTo::rep, typename QFrom::rep> &&
100- ValuePreservingScaling2Reps <QFrom::unit, typename QFrom::rep, QTo::unit, typename QTo::rep>;
100+ ValuePreservingConversion <QFrom::unit, typename QFrom::rep, QTo::unit, typename QTo::rep>;
101101
102102template <typename T, typename Rep>
103103concept ScalarValuePreservingTo = (!Quantity<T>) && Scalar<T> && is_value_preserving<T, Rep>;
@@ -245,7 +245,7 @@ class quantity {
245245 }
246246
247247 template <detail::WeakUnitOf<quantity_spec> ToU>
248- requires detail::ValuePreservingScaling1Rep <unit, ToU{}, rep>
248+ requires detail::ValuePreservingScaling <unit, ToU{}, rep>
249249 [[nodiscard]] constexpr QuantityOf<quantity_spec> auto in (ToU) const
250250 {
251251 return quantity<detail::make_reference (quantity_spec, ToU{}), Rep>{*this };
@@ -260,7 +260,7 @@ class quantity {
260260
261261 template <RepresentationOf<quantity_spec> ToRep, detail::WeakUnitOf<quantity_spec> ToU>
262262 requires detail::ValuePreservingConstruction<ToRep, rep> &&
263- detail::ValuePreservingScaling2Reps <unit, rep, ToU{}, ToRep>
263+ detail::ValuePreservingConversion <unit, rep, ToU{}, ToRep>
264264 [[nodiscard]] constexpr QuantityOf<quantity_spec> auto in (ToU) const
265265 {
266266 return quantity<detail::make_reference (quantity_spec, ToU{}), ToRep>{*this };
@@ -312,7 +312,7 @@ class quantity {
312312#endif
313313
314314 template <detail::WeakUnitOf<quantity_spec> U>
315- requires detail::ValuePreservingScaling1Rep <unit, U{}, rep>
315+ requires detail::ValuePreservingScaling <unit, U{}, rep>
316316 [[nodiscard]] constexpr rep numerical_value_in (U) const noexcept
317317 {
318318 return in (U{}).numerical_value_is_an_implementation_detail_ ;
@@ -400,7 +400,7 @@ class quantity {
400400 // compound assignment operators
401401 template <auto R2, typename Rep2>
402402 requires (implicitly_convertible(get_quantity_spec(R2), quantity_spec)) &&
403- detail::ValuePreservingScaling2Reps <get_unit(R2), Rep2, unit, rep> && requires (rep& a, const Rep2 b) {
403+ detail::ValuePreservingConversion <get_unit(R2), Rep2, unit, rep> && requires (rep& a, const Rep2 b) {
404404 { a += b } -> std::same_as<rep&>;
405405 }
406406 constexpr quantity& operator +=(const quantity<R2, Rep2>& other) &
@@ -414,7 +414,7 @@ class quantity {
414414
415415 template <auto R2, typename Rep2>
416416 requires (implicitly_convertible(get_quantity_spec(R2), quantity_spec)) &&
417- detail::ValuePreservingScaling2Reps <get_unit(R2), Rep2, unit, rep> && requires (rep& a, const Rep2 b) {
417+ detail::ValuePreservingConversion <get_unit(R2), Rep2, unit, rep> && requires (rep& a, const Rep2 b) {
418418 { a -= b } -> std::same_as<rep&>;
419419 }
420420 constexpr quantity& operator -=(const quantity<R2, Rep2>& other) &
@@ -428,7 +428,7 @@ class quantity {
428428
429429 template <auto R2, typename Rep2>
430430 requires (!treat_as_floating_point<rep>) && (implicitly_convertible(get_quantity_spec(R2), quantity_spec)) &&
431- detail::ValuePreservingScaling2Reps <get_unit(R2), Rep2, unit, rep> && requires (rep& a, const Rep2 b) {
431+ detail::ValuePreservingConversion <get_unit(R2), Rep2, unit, rep> && requires (rep& a, const Rep2 b) {
432432 { a %= b } -> std::same_as<rep&>;
433433 }
434434 constexpr quantity& operator %=(const quantity<R2, Rep2>& other) &
0 commit comments