From 7fbc52dc935c86ff82c27a8ac16ce2acadc7c08b Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 7 Jun 2024 09:41:35 +0200 Subject: [PATCH] refactor: `expr_map_impl` now caches the value --- src/core/include/mp-units/framework/expression_template.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/include/mp-units/framework/expression_template.h b/src/core/include/mp-units/framework/expression_template.h index 291bfedb2..f84bce294 100644 --- a/src/core/include/mp-units/framework/expression_template.h +++ b/src/core/include/mp-units/framework/expression_template.h @@ -534,8 +534,8 @@ template typename Proj, template typename To, ty expr_type_projectable... Dens> [[nodiscard]] consteval auto expr_map_impl(type_list, type_list) { - return (OneType{} * ... * map_power(typename expr_type_map::type{})) / - (OneType{} * ... * map_power(typename expr_type_map::type{})); + return decltype(decltype((OneType{} * ... * map_power(typename expr_type_map::type{}))){} / + decltype((OneType{} * ... * map_power(typename expr_type_map::type{}))){}){}; } /**