From 793f4526ae0f8a175d82b8b7fb0c8749196e1f20 Mon Sep 17 00:00:00 2001 From: anonymous Date: Thu, 28 Aug 2025 18:09:52 +0800 Subject: [PATCH] Fix gcc modulize build. When trying to compile `beman/execution` into `C++20 Modules`, g++ complains about `exposes TU-local entity get(...)` in `beman/execution/detail/completion_domain.hpp`, where - `get` is defined to do compile-time type calculation - `get` is a function-local lambda with local captures (that is to say, is TU-local) - TU-local entities will indirectly affect all the entities which depends on it to be not `module-exportable`. So we made a tiny change on `get` function, making it `constexpr` and `exportable`. --- include/beman/execution/detail/completion_domain.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/beman/execution/detail/completion_domain.hpp b/include/beman/execution/detail/completion_domain.hpp index ea345ad6..f9d1e72e 100644 --- a/include/beman/execution/detail/completion_domain.hpp +++ b/include/beman/execution/detail/completion_domain.hpp @@ -43,7 +43,7 @@ template ); - auto get = [&sender](Tag) { + constexpr auto get = [](Tag, const Sender& sender) { if constexpr (requires { ::beman::execution::get_domain( ::beman::execution::get_completion_scheduler(::beman::execution::get_env(sender))); @@ -56,9 +56,9 @@ constexpr auto completion_domain(const Sender& sender) noexcept { }; using type = typename completion_domain_merge< - typename completion_domain_merge::type, - decltype(get(::beman::execution::set_value))>::type; + typename completion_domain_merge::type, + decltype(get(::beman::execution::set_value, sender))>::type; return ::std::conditional_t< ::std::same_as, Default, type>(); } } // namespace beman::execution::detail