mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 12:24:26 +02:00
refactor: SameDimension
concept is not needed and can be inlined in DimensionOf
This commit is contained in:
@@ -74,10 +74,6 @@ constexpr bool is_per_of_dims<per<Ts...>> =
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
concept DerivedDimensionExpr = BaseDimension<T> || is_dimension_one<T>::value || IsPowerOfDim<T> || is_per_of_dims<T>;
|
concept DerivedDimensionExpr = BaseDimension<T> || is_dimension_one<T>::value || IsPowerOfDim<T> || is_per_of_dims<T>;
|
||||||
|
|
||||||
template<auto D1, auto D2>
|
|
||||||
concept SameDimension =
|
|
||||||
Dimension<MP_UNITS_REMOVE_CONST(decltype(D1))> && Dimension<MP_UNITS_REMOVE_CONST(decltype(D2))> && (D1 == D2);
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,6 +82,6 @@ concept SameDimension =
|
|||||||
* Satisfied when both argument satisfy a `Dimension` concept and when they compare equal.
|
* Satisfied when both argument satisfy a `Dimension` concept and when they compare equal.
|
||||||
*/
|
*/
|
||||||
MP_UNITS_EXPORT template<typename T, auto D>
|
MP_UNITS_EXPORT template<typename T, auto D>
|
||||||
concept DimensionOf = Dimension<T> && Dimension<MP_UNITS_REMOVE_CONST(decltype(D))> && detail::SameDimension<T{}, D>;
|
concept DimensionOf = Dimension<T> && Dimension<MP_UNITS_REMOVE_CONST(decltype(D))> && (T{} == D);
|
||||||
|
|
||||||
} // namespace mp_units
|
} // namespace mp_units
|
||||||
|
Reference in New Issue
Block a user