Skip to content

Commit 4ca7476

Browse files
author
anonymous
authored
Fix gcc modulize build. (#183)
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`.
1 parent a5843eb commit 4ca7476

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/beman/execution/detail/completion_domain.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ template <typename Default = ::beman::execution::default_domain, typename Sender
4343
constexpr auto completion_domain(const Sender& sender) noexcept {
4444

4545
static_assert(::beman::execution::sender<Sender>);
46-
auto get = [&sender]<typename Tag>(Tag) {
46+
constexpr auto get = []<typename Tag>(Tag, const Sender& sender) {
4747
if constexpr (requires {
4848
::beman::execution::get_domain(
4949
::beman::execution::get_completion_scheduler<Tag>(::beman::execution::get_env(sender)));
@@ -56,9 +56,9 @@ constexpr auto completion_domain(const Sender& sender) noexcept {
5656
};
5757

5858
using type = typename completion_domain_merge<
59-
typename completion_domain_merge<decltype(get(::beman::execution::set_error)),
60-
decltype(get(::beman::execution::set_stopped))>::type,
61-
decltype(get(::beman::execution::set_value))>::type;
59+
typename completion_domain_merge<decltype(get(::beman::execution::set_error, sender)),
60+
decltype(get(::beman::execution::set_stopped, sender))>::type,
61+
decltype(get(::beman::execution::set_value, sender))>::type;
6262
return ::std::conditional_t< ::std::same_as<type, completion_domain_undefined>, Default, type>();
6363
}
6464
} // namespace beman::execution::detail

0 commit comments

Comments
 (0)