From 035eb3acb4df06a1689c266571dd2e3c8326a0cf Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sun, 20 Oct 2024 21:10:03 +0200 Subject: [PATCH] refactor: `SameDimension` concept is not needed and can be inlined in `DimensionOf` --- src/core/include/mp-units/framework/dimension_concepts.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/core/include/mp-units/framework/dimension_concepts.h b/src/core/include/mp-units/framework/dimension_concepts.h index 60539ee5..18bec37a 100644 --- a/src/core/include/mp-units/framework/dimension_concepts.h +++ b/src/core/include/mp-units/framework/dimension_concepts.h @@ -74,10 +74,6 @@ constexpr bool is_per_of_dims> = template concept DerivedDimensionExpr = BaseDimension || is_dimension_one::value || IsPowerOfDim || is_per_of_dims; -template -concept SameDimension = - Dimension && Dimension && (D1 == D2); - } // namespace detail /** @@ -86,6 +82,6 @@ concept SameDimension = * Satisfied when both argument satisfy a `Dimension` concept and when they compare equal. */ MP_UNITS_EXPORT template -concept DimensionOf = Dimension && Dimension && detail::SameDimension; +concept DimensionOf = Dimension && Dimension && (T{} == D); } // namespace mp_units