From cbe37cdadf901a5132c85291d18ab330c18ebc5d Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 6 Sep 2024 15:57:11 +0200 Subject: [PATCH] fix: compiler crashes workaround --- src/core/include/mp-units/bits/sudo_cast.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/include/mp-units/bits/sudo_cast.h b/src/core/include/mp-units/bits/sudo_cast.h index 3b489088..478c8b86 100644 --- a/src/core/include/mp-units/bits/sudo_cast.h +++ b/src/core/include/mp-units/bits/sudo_cast.h @@ -108,7 +108,9 @@ template; using multiplier_type = typename type_traits::multiplier_type; - auto scale = [&](std::invocable auto func) { + // TODO the below crashed nearly every compiler I tried it on + // auto scale = [&](std::invocable auto func) { + auto scale = [&](auto func) { auto res = static_cast(func(static_cast(q.numerical_value_is_an_implementation_detail_))); return To{res, To::reference};