From ee701cf4e739e7aff23e741996e14201413a96ee Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sat, 2 Nov 2019 13:56:53 +0100 Subject: [PATCH] dimension refactoring --- src/include/units/dimension.h | 23 ++++++----------------- test/unit_test/static/dimension_test.cpp | 2 +- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/include/units/dimension.h b/src/include/units/dimension.h index ed4add42..7ac6f7b0 100644 --- a/src/include/units/dimension.h +++ b/src/include/units/dimension.h @@ -213,9 +213,7 @@ namespace units { }; template - struct make_dimension { - using type = detail::dim_consolidate::type, exp_less>>::type; - }; + using make_dimension = dim_consolidate::type, exp_less>>::type; } // namespace detail @@ -224,22 +222,13 @@ namespace units { struct derived_dimension : downcast_child> {}; // merge_dimension - namespace detail { - - template - struct merge_dimension_impl { - using type = detail::dim_consolidate>::type; - }; - - } - template - using merge_dimension = detail::merge_dimension_impl::type; + using merge_dimension = detail::dim_consolidate>::type; // dimension_multiply namespace detail { - template + template struct dimension_multiply_impl; template @@ -253,7 +242,7 @@ namespace units { // dimension_divide namespace detail { - template + template struct dimension_divide_impl; template @@ -269,7 +258,7 @@ namespace units { // dimension_sqrt namespace detail { - template + template struct dimension_sqrt_impl; template @@ -283,7 +272,7 @@ namespace units { // dimension_pow namespace detail { - template + template struct dimension_pow_impl; template diff --git a/test/unit_test/static/dimension_test.cpp b/test/unit_test/static/dimension_test.cpp index 368a2c38..c476ce04 100644 --- a/test/unit_test/static/dimension_test.cpp +++ b/test/unit_test/static/dimension_test.cpp @@ -58,7 +58,7 @@ namespace { // make_dimension template - using make_dimension = detail::make_dimension::type; + using make_dimension = detail::make_dimension; static_assert(std::is_same_v>, dimension>>); static_assert(std::is_same_v, exp>, dimension, exp>>);