From dcf05687cf98a91b3620f0484d1e7166de7dbe7a Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Mon, 18 Nov 2024 20:34:15 +0100 Subject: [PATCH] perf: `expr_projectable` concept removed to improve compilation performance --- .../mp-units/framework/expression_template.h | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/core/include/mp-units/framework/expression_template.h b/src/core/include/mp-units/framework/expression_template.h index 38dd14d3f..7853a03bb 100644 --- a/src/core/include/mp-units/framework/expression_template.h +++ b/src/core/include/mp-units/framework/expression_template.h @@ -521,24 +521,6 @@ struct expr_type_map, Proj> { using type = power, Ints...>; }; -template typename Proj> -concept expr_type_projectable = (requires { typename Proj; } || - (is_specialization_of_power && requires { typename Proj; })); - -template typename Proj> -constexpr bool expr_projectable_impl = false; - -template typename Proj> -constexpr bool expr_projectable_impl, Proj> = (... && expr_type_projectable); - -template typename Proj> -concept expr_projectable = requires { - typename T::_num_; - typename T::_den_; - requires expr_projectable_impl; - requires expr_projectable_impl; -}; - template [[nodiscard]] consteval auto map_power(T t) { @@ -552,8 +534,7 @@ template } template typename Proj, template typename To, SymbolicArg OneType, - template typename Pred, expr_type_projectable... Nums, - expr_type_projectable... Dens> + template typename Pred, typename... Nums, typename... Dens> [[nodiscard]] consteval auto expr_map_impl(type_list, type_list) { return (OneType{} * ... * map_power(typename expr_type_map::type{})) / @@ -570,7 +551,7 @@ template typename Proj, template typename To, Sy * @tparam T expression template to map from */ template typename Proj, template typename To, SymbolicArg OneType, - template typename Pred, expr_projectable T> + template typename Pred, typename T> [[nodiscard]] consteval auto expr_map(T) { if constexpr (type_list_size + type_list_size == 0)