@@ -205,15 +205,15 @@ concept ComplexScalar = requires(const T v, const T& ref) {
205205 * @brief MagnitudeScalable
206206 *
207207 * A type is `MagnitudeScalable` if it can be scaled by a unit magnitude, i.e.
208- * `mp_units::scaling_traits<T, T>::scale<M>( value)` is well-formed and returns something
208+ * `mp_units::scale<T>(mp_units::mag<1>, value)` is well-formed and returns something
209209 * convertible to `T`. This covers:
210210 * - the library's built-in floating-point scaling (treat_as_floating_point types),
211211 * - the library's built-in fixed-point integer scaling, and
212212 * - any user-provided `mp_units::scaling_traits<T, T>` specialization.
213213 */
214214template <typename T>
215215concept MagnitudeScalable = WeaklyRegular<T> && requires (T a) {
216- { scaling_traits<T, T>:: template scale<mp_units::mag<1 >>( a) } -> std::convertible_to<T>;
216+ { ::mp_units:: scale<T>( mp_units::mag<1 >, a) } -> std::convertible_to<T>;
217217};
218218
219219template <typename T>
@@ -295,35 +295,21 @@ namespace detail {
295295template <typename T>
296296constexpr bool is_quantity_like = false ;
297297
298- // `std::complex<double>` * `long double` does not work, this is why we use the `value_type` if present and correct
299- // TODO Remove when P3788 gets accepted
300- template <typename T>
301- using scaling_factor_type_t = conditional<std::is_arithmetic_v<value_type_t <T>>, value_type_t <T>,
302- conditional<treat_as_floating_point<T>, long double , std::intmax_t >>;
303-
304- // TODO replace the below and above with the logic from #615 when available
305- template <typename T>
306- concept ScalableByFactor = requires (const T v, const scaling_factor_type_t <T> f) {
307- { v * f } -> std::common_with<T>;
308- { f * v } -> std::common_with<T>;
309- { v / f } -> std::common_with<T>;
310- };
311-
312298// TODO how can we use `(!Quantity<T>)` below?
313299template <typename T>
314300concept NotQuantity = (!is_quantity_like<T>);
315301
316302template <typename T>
317- concept RealScalarRepresentation = NotQuantity<T> && RealScalar<T> && ScalableByFactor <T>;
303+ concept RealScalarRepresentation = NotQuantity<T> && RealScalar<T> && MagnitudeScalable <T>;
318304
319305template <typename T>
320- concept ComplexScalarRepresentation = NotQuantity<T> && ComplexScalar<T> && ScalableByFactor <T>;
306+ concept ComplexScalarRepresentation = NotQuantity<T> && ComplexScalar<T> && MagnitudeScalable <T>;
321307
322308template <typename T>
323309concept ScalarRepresentation = RealScalarRepresentation<T> || ComplexScalarRepresentation<T>;
324310
325311template <typename T>
326- concept VectorRepresentation = NotQuantity<T> && Vector<T> && ScalableByFactor <T>;
312+ concept VectorRepresentation = NotQuantity<T> && Vector<T> && MagnitudeScalable <T>;
327313
328314// template<typename T>
329315// concept TensorRepresentation = NotQuantity<T> && Tensor<T>;
0 commit comments