From 4056a3a8041ec33fd5a1837f2729bc063e372483 Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Fri, 24 Jul 2026 10:39:36 -0700 Subject: [PATCH 01/20] Start extending what's exported from stdexec Add a test that `just` can be invoked. --- include/stdexec/__detail/__execution_fwd.hpp | 2 +- include/stdexec/__detail/__just.hpp | 2 +- test/stdexec/module/test_module.cpp | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index acb1af7fc..7e54be69f 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -276,7 +276,7 @@ namespace STDEXEC ////////////////////////////////////////////////////////////////////////////////////////////////// STDEXEC_MODULE_EXPORT struct just_t; - extern just_t const just; + STDEXEC_MODULE_EXPORT extern just_t const just; struct just_error_t; extern just_error_t const just_error; diff --git a/include/stdexec/__detail/__just.hpp b/include/stdexec/__detail/__just.hpp index 6b067a0ae..053afba5c 100644 --- a/include/stdexec/__detail/__just.hpp +++ b/include/stdexec/__detail/__just.hpp @@ -298,7 +298,7 @@ namespace STDEXEC //! description, completion signatures, and a usage example. //! //! @hideinitializer - inline constexpr just_t just{}; + STDEXEC_MODULE_EXPORT inline constexpr just_t just{}; //! @brief The customization point object for the @c just_error sender factory. //! diff --git a/test/stdexec/module/test_module.cpp b/test/stdexec/module/test_module.cpp index 63b2c8dd8..7e017f73a 100644 --- a/test/stdexec/module/test_module.cpp +++ b/test/stdexec/module/test_module.cpp @@ -23,8 +23,15 @@ namespace ex = stdexec; namespace { - TEST_CASE("I can use ex::just in a modules build", "[modules]") + TEST_CASE("I can utter ex::just_t in a modules build", "[modules]") { STATIC_REQUIRE(sizeof(ex::just_t) > 0); } + + TEST_CASE("I can invoke ex::just() in a modules build", "[modules]") + { + auto sender = ex::just(); + + STATIC_REQUIRE(sizeof(decltype(sender)) > 0); + } } // namespace From 260097128665bef7616192945a910274b120265c Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Fri, 24 Jul 2026 11:03:12 -0700 Subject: [PATCH 02/20] Export more stuff This diff exports enough of `stdexec::` that I can `connect` and start a just-sender with a no-op receiver. Along the way, I accidentally discovered that `STDEXEC_MODULE_EXPORT` can be placed on the forward declaration in `__execution_fwd.hpp` and *not* on the "real" declaration in the relevant header, so I updated `__just.hpp` to be more concise. --- include/stdexec/__detail/__execution_fwd.hpp | 4 ++-- include/stdexec/__detail/__just.hpp | 4 ++-- test/stdexec/module/test_module.cpp | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index 7e54be69f..5a72598fd 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -174,7 +174,7 @@ namespace STDEXEC struct sender_tag; struct operation_state_tag; struct scheduler_tag; - struct receiver_tag; + STDEXEC_MODULE_EXPORT struct receiver_tag; // concept tag aliases for backwards compatibility: using sender_t = sender_tag; @@ -227,7 +227,7 @@ namespace STDEXEC ////////////////////////////////////////////////////////////////////////////////////////////////// struct connect_t; - extern connect_t const connect; + STDEXEC_MODULE_EXPORT extern connect_t const connect; template using connect_result_t = __call_result_t; diff --git a/include/stdexec/__detail/__just.hpp b/include/stdexec/__detail/__just.hpp index 053afba5c..ff9df2215 100644 --- a/include/stdexec/__detail/__just.hpp +++ b/include/stdexec/__detail/__just.hpp @@ -145,7 +145,7 @@ namespace STDEXEC //! @see stdexec::just_error — synchronously complete with an error //! @see stdexec::just_stopped — synchronously complete with stopped //! @see stdexec::read_env — synchronously complete with a value read from the environment - STDEXEC_MODULE_EXPORT struct just_t + struct just_t { using __tag_t = set_value_t; @@ -298,7 +298,7 @@ namespace STDEXEC //! description, completion signatures, and a usage example. //! //! @hideinitializer - STDEXEC_MODULE_EXPORT inline constexpr just_t just{}; + inline constexpr just_t just{}; //! @brief The customization point object for the @c just_error sender factory. //! diff --git a/test/stdexec/module/test_module.cpp b/test/stdexec/module/test_module.cpp index 7e017f73a..968691c52 100644 --- a/test/stdexec/module/test_module.cpp +++ b/test/stdexec/module/test_module.cpp @@ -34,4 +34,20 @@ namespace STATIC_REQUIRE(sizeof(decltype(sender)) > 0); } + + TEST_CASE("I can connect and start a just-sender in a modules build", "[modules]") + { + struct receiver + { + using receiver_concept = ex::receiver_tag; + + void set_value() && noexcept {} + }; + + auto op = ex::connect(ex::just(), receiver{}); + + STATIC_REQUIRE(sizeof(decltype(op)) > 0); + + op.start(); + } } // namespace From 5b231ed8f99094d077ad0b7633cc6ce524d4e8f9 Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Fri, 24 Jul 2026 11:15:30 -0700 Subject: [PATCH 03/20] Export everyting in __execution_fwd.hpp This builds and the tests pass. I'm not exercising any of the newly-exported stuff in a test, but I think the way to do that is to start adding existing tests to the modules-enabled build. --- include/stdexec/__detail/__execution_fwd.hpp | 222 ++++++++++--------- 1 file changed, 112 insertions(+), 110 deletions(-) diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index 5a72598fd..691bdebe2 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -70,19 +70,19 @@ namespace STDEXEC using __decayed_std_tuple = std::tuple<__decay_t<_Ts>...>; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct default_domain; + STDEXEC_MODULE_EXPORT struct default_domain; - template + STDEXEC_MODULE_EXPORT template struct indeterminate_domain; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct set_value_t; - struct set_error_t; - struct set_stopped_t; + STDEXEC_MODULE_EXPORT struct set_value_t; + STDEXEC_MODULE_EXPORT struct set_error_t; + STDEXEC_MODULE_EXPORT struct set_stopped_t; - extern set_value_t const set_value; - extern set_error_t const set_error; - extern set_stopped_t const set_stopped; + STDEXEC_MODULE_EXPORT extern set_value_t const set_value; + STDEXEC_MODULE_EXPORT extern set_error_t const set_error; + STDEXEC_MODULE_EXPORT extern set_stopped_t const set_stopped; enum class __disposition { @@ -96,7 +96,7 @@ namespace STDEXEC template concept __completion_tag = __one_of<_Tag, set_value_t, set_error_t, set_stopped_t>; - template + STDEXEC_MODULE_EXPORT template extern bool const enable_receiver; namespace __env @@ -105,21 +105,21 @@ namespace STDEXEC struct cprop; } // namespace __env - template + STDEXEC_MODULE_EXPORT template struct prop; - template + STDEXEC_MODULE_EXPORT template struct env; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct get_env_t; - extern get_env_t const get_env; + STDEXEC_MODULE_EXPORT struct get_env_t; + STDEXEC_MODULE_EXPORT extern get_env_t const get_env; - template + STDEXEC_MODULE_EXPORT template using env_of_t = __call_result_t; ////////////////////////////////////////////////////////////////////////////////////////////////// - enum class forward_progress_guarantee + STDEXEC_MODULE_EXPORT enum class forward_progress_guarantee { concurrent, parallel, @@ -127,32 +127,32 @@ namespace STDEXEC }; struct __execute_may_block_caller_t; - struct get_forward_progress_guarantee_t; - struct get_scheduler_t; - struct get_start_scheduler_t; - struct get_delegation_scheduler_t; - template <__completion_tag _CPO> + STDEXEC_MODULE_EXPORT struct get_forward_progress_guarantee_t; + STDEXEC_MODULE_EXPORT struct get_scheduler_t; + STDEXEC_MODULE_EXPORT struct get_start_scheduler_t; + STDEXEC_MODULE_EXPORT struct get_delegation_scheduler_t; + STDEXEC_MODULE_EXPORT template <__completion_tag _CPO> struct get_completion_scheduler_t; - template + STDEXEC_MODULE_EXPORT template struct get_completion_domain_t; template <__completion_tag _CPO> struct __get_completion_behavior_t; - struct get_domain_t; - struct get_await_completion_adaptor_t; + STDEXEC_MODULE_EXPORT struct get_domain_t; + STDEXEC_MODULE_EXPORT struct get_await_completion_adaptor_t; struct __debug_env_t; extern __execute_may_block_caller_t const __execute_may_block_caller; - extern get_forward_progress_guarantee_t const get_forward_progress_guarantee; - extern get_scheduler_t const get_scheduler; - extern get_start_scheduler_t const get_start_scheduler; - extern get_delegation_scheduler_t const get_delegation_scheduler; - template <__completion_tag _CPO> + STDEXEC_MODULE_EXPORT extern get_forward_progress_guarantee_t const get_forward_progress_guarantee; + STDEXEC_MODULE_EXPORT extern get_scheduler_t const get_scheduler; + STDEXEC_MODULE_EXPORT extern get_start_scheduler_t const get_start_scheduler; + STDEXEC_MODULE_EXPORT extern get_delegation_scheduler_t const get_delegation_scheduler; + STDEXEC_MODULE_EXPORT template <__completion_tag _CPO> extern get_completion_scheduler_t<_CPO> const get_completion_scheduler; - template + STDEXEC_MODULE_EXPORT template extern get_completion_domain_t<_CPO> const get_completion_domain; - extern get_domain_t const get_domain; - extern get_await_completion_adaptor_t const get_await_completion_adaptor; + STDEXEC_MODULE_EXPORT extern get_domain_t const get_domain; + STDEXEC_MODULE_EXPORT extern get_await_completion_adaptor_t const get_await_completion_adaptor; template using __completion_domain_t = __call_result_or_t, @@ -171,12 +171,14 @@ namespace STDEXEC ////////////////////////////////////////////////////////////////////////////////////////////////// // concept tag types: - struct sender_tag; - struct operation_state_tag; - struct scheduler_tag; + STDEXEC_MODULE_EXPORT struct sender_tag; + STDEXEC_MODULE_EXPORT struct operation_state_tag; + STDEXEC_MODULE_EXPORT struct scheduler_tag; STDEXEC_MODULE_EXPORT struct receiver_tag; // concept tag aliases for backwards compatibility: + // + // not exported because no module consumer could be using them using sender_t = sender_tag; using operation_state_t = operation_state_tag; using scheduler_t = scheduler_tag; @@ -190,21 +192,21 @@ namespace STDEXEC using __domain_of_t = __decay_t<__call_result_t>; ////////////////////////////////////////////////////////////////////////////////////////////////// - template + STDEXEC_MODULE_EXPORT template struct completion_signatures; template concept __valid_completion_signatures = __ok<_Completions> && __is_instance_of<_Completions, completion_signatures>; - struct dependent_sender_error; + STDEXEC_MODULE_EXPORT struct dependent_sender_error; namespace __cmplsigs { - struct get_completion_signatures_t; + STDEXEC_MODULE_EXPORT struct get_completion_signatures_t; } // namespace __cmplsigs - using __cmplsigs::get_completion_signatures_t; + STDEXEC_MODULE_EXPORT using __cmplsigs::get_completion_signatures_t; # if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() @@ -226,119 +228,119 @@ namespace STDEXEC consteval auto __throw_compile_time_error(__mexception<_What...>); ////////////////////////////////////////////////////////////////////////////////////////////////// - struct connect_t; + STDEXEC_MODULE_EXPORT struct connect_t; STDEXEC_MODULE_EXPORT extern connect_t const connect; - template + STDEXEC_MODULE_EXPORT template using connect_result_t = __call_result_t; - template + STDEXEC_MODULE_EXPORT template extern bool const enable_sender; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct start_t; - extern start_t const start; + STDEXEC_MODULE_EXPORT struct start_t; + STDEXEC_MODULE_EXPORT extern start_t const start; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct schedule_t; - extern schedule_t const schedule; + STDEXEC_MODULE_EXPORT struct schedule_t; + STDEXEC_MODULE_EXPORT extern schedule_t const schedule; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct as_awaitable_t; - extern as_awaitable_t const as_awaitable; + STDEXEC_MODULE_EXPORT struct as_awaitable_t; + STDEXEC_MODULE_EXPORT extern as_awaitable_t const as_awaitable; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct transform_sender_t; - extern transform_sender_t const transform_sender; + STDEXEC_MODULE_EXPORT struct transform_sender_t; + STDEXEC_MODULE_EXPORT extern transform_sender_t const transform_sender; - template + STDEXEC_MODULE_EXPORT template using transform_sender_result_t = __call_result_t; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct starts_on_t; - extern starts_on_t const starts_on; + STDEXEC_MODULE_EXPORT struct starts_on_t; + STDEXEC_MODULE_EXPORT extern starts_on_t const starts_on; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct schedule_from_t; - extern schedule_from_t const schedule_from; + STDEXEC_MODULE_EXPORT struct schedule_from_t; + STDEXEC_MODULE_EXPORT extern schedule_from_t const schedule_from; - struct continues_on_t; - extern continues_on_t const continues_on; + STDEXEC_MODULE_EXPORT struct continues_on_t; + STDEXEC_MODULE_EXPORT extern continues_on_t const continues_on; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct bulk_t; - struct bulk_chunked_t; - struct bulk_unchunked_t; + STDEXEC_MODULE_EXPORT struct bulk_t; + STDEXEC_MODULE_EXPORT struct bulk_chunked_t; + STDEXEC_MODULE_EXPORT struct bulk_unchunked_t; - extern bulk_t const bulk; - extern bulk_chunked_t const bulk_chunked; - extern bulk_unchunked_t const bulk_unchunked; + STDEXEC_MODULE_EXPORT extern bulk_t const bulk; + STDEXEC_MODULE_EXPORT extern bulk_chunked_t const bulk_chunked; + STDEXEC_MODULE_EXPORT extern bulk_unchunked_t const bulk_unchunked; ////////////////////////////////////////////////////////////////////////////////////////////////// STDEXEC_MODULE_EXPORT struct just_t; STDEXEC_MODULE_EXPORT extern just_t const just; - struct just_error_t; - extern just_error_t const just_error; + STDEXEC_MODULE_EXPORT struct just_error_t; + STDEXEC_MODULE_EXPORT extern just_error_t const just_error; - struct just_stopped_t; - extern just_stopped_t const just_stopped; + STDEXEC_MODULE_EXPORT struct just_stopped_t; + STDEXEC_MODULE_EXPORT extern just_stopped_t const just_stopped; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct then_t; - extern then_t const then; + STDEXEC_MODULE_EXPORT struct then_t; + STDEXEC_MODULE_EXPORT extern then_t const then; - struct upon_error_t; - extern upon_error_t const upon_error; + STDEXEC_MODULE_EXPORT struct upon_error_t; + STDEXEC_MODULE_EXPORT extern upon_error_t const upon_error; - struct upon_stopped_t; - extern upon_stopped_t const upon_stopped; + STDEXEC_MODULE_EXPORT struct upon_stopped_t; + STDEXEC_MODULE_EXPORT extern upon_stopped_t const upon_stopped; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct let_value_t; - extern let_value_t const let_value; + STDEXEC_MODULE_EXPORT struct let_value_t; + STDEXEC_MODULE_EXPORT extern let_value_t const let_value; - struct let_error_t; - extern let_error_t const let_error; + STDEXEC_MODULE_EXPORT struct let_error_t; + STDEXEC_MODULE_EXPORT extern let_error_t const let_error; - struct let_stopped_t; - extern let_stopped_t const let_stopped; + STDEXEC_MODULE_EXPORT struct let_stopped_t; + STDEXEC_MODULE_EXPORT extern let_stopped_t const let_stopped; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct when_all_t; - extern when_all_t const when_all; + STDEXEC_MODULE_EXPORT struct when_all_t; + STDEXEC_MODULE_EXPORT extern when_all_t const when_all; - struct when_all_with_variant_t; - extern when_all_with_variant_t const when_all_with_variant; + STDEXEC_MODULE_EXPORT struct when_all_with_variant_t; + STDEXEC_MODULE_EXPORT extern when_all_with_variant_t const when_all_with_variant; ////////////////////////////////////////////////////////////////////////////////////////////////// struct __read_env_t; - extern __read_env_t const read_env; + STDEXEC_MODULE_EXPORT extern __read_env_t const read_env; struct __write_env_t; - extern __write_env_t const write_env; + STDEXEC_MODULE_EXPORT extern __write_env_t const write_env; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct into_variant_t; - extern into_variant_t const into_variant; + STDEXEC_MODULE_EXPORT struct into_variant_t; + STDEXEC_MODULE_EXPORT extern into_variant_t const into_variant; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct on_t; - extern on_t const on; + STDEXEC_MODULE_EXPORT struct on_t; + STDEXEC_MODULE_EXPORT extern on_t const on; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct affine_t; - extern affine_t const affine; + STDEXEC_MODULE_EXPORT struct affine_t; + STDEXEC_MODULE_EXPORT extern affine_t const affine; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct stopped_as_error_t; - extern stopped_as_error_t const stopped_as_error; + STDEXEC_MODULE_EXPORT struct stopped_as_error_t; + STDEXEC_MODULE_EXPORT extern stopped_as_error_t const stopped_as_error; - struct stopped_as_optional_t; - extern stopped_as_optional_t const stopped_as_optional; + STDEXEC_MODULE_EXPORT struct stopped_as_optional_t; + STDEXEC_MODULE_EXPORT extern stopped_as_optional_t const stopped_as_optional; ////////////////////////////////////////////////////////////////////////////////////////////////// - template <__class _Derived> + STDEXEC_MODULE_EXPORT template <__class _Derived> struct sender_adaptor_closure; ////////////////////////////////////////////////////////////////////////////////////////////////// @@ -364,30 +366,30 @@ namespace experimental::execution namespace exec = experimental::execution; STDEXEC_P2300_NAMESPACE_BEGIN() - struct forwarding_query_t; - struct get_allocator_t; - struct get_stop_token_t; + STDEXEC_MODULE_EXPORT struct forwarding_query_t; + STDEXEC_MODULE_EXPORT struct get_allocator_t; + STDEXEC_MODULE_EXPORT struct get_stop_token_t; - extern forwarding_query_t const forwarding_query; - extern get_allocator_t const get_allocator; - extern get_stop_token_t const get_stop_token; + STDEXEC_MODULE_EXPORT extern forwarding_query_t const forwarding_query; + STDEXEC_MODULE_EXPORT extern get_allocator_t const get_allocator; + STDEXEC_MODULE_EXPORT extern get_stop_token_t const get_stop_token; - template + STDEXEC_MODULE_EXPORT template using stop_token_of_t = STDEXEC::__decay_t>; - struct never_stop_token; - class inplace_stop_source; - class inplace_stop_token; - template + STDEXEC_MODULE_EXPORT struct never_stop_token; + STDEXEC_MODULE_EXPORT class inplace_stop_source; + STDEXEC_MODULE_EXPORT class inplace_stop_token; + STDEXEC_MODULE_EXPORT template class inplace_stop_callback; STDEXEC_P2300_NAMESPACE_END() //////////////////////////////////////////////////////////////////////////////////////////////////// STDEXEC_P2300_NAMESPACE_BEGIN(this_thread) - struct sync_wait_t; - struct sync_wait_with_variant_t; - extern sync_wait_t const sync_wait; - extern sync_wait_with_variant_t const sync_wait_with_variant; + STDEXEC_MODULE_EXPORT struct sync_wait_t; + STDEXEC_MODULE_EXPORT struct sync_wait_with_variant_t; + STDEXEC_MODULE_EXPORT extern sync_wait_t const sync_wait; + STDEXEC_MODULE_EXPORT extern sync_wait_with_variant_t const sync_wait_with_variant; STDEXEC_P2300_NAMESPACE_END(this_thread) // NOT TO SPEC: make sync_wait et. al. available in namespace STDEXEC (possibly From 5514e86e2d189970c8634bc705258f307a764c3f Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Fri, 24 Jul 2026 12:39:06 -0700 Subject: [PATCH 04/20] Broken test_just.cpp This diff adds `test_just.cpp` to the modularized tests but it's currently broken. It looks to me like the tests are using internal metafunctions from `__meta.hpp` outside the module boundary. This seems reasonable for tests of the library, but impermissable for general library consumers. I'm going to experiment with something like a `stdexec.internals` module to share things between the library and its tests, and maybe between `stdexec` and a future `stdexec.exec`. --- include/stdexec/__detail/__bulk.hpp | 31 +++-- .../__detail/__completion_signatures_of.hpp | 27 ++-- include/stdexec/__detail/__connect.hpp | 39 +++--- include/stdexec/__detail/__continues_on.hpp | 45 ++++--- .../stdexec/__detail/__inline_scheduler.hpp | 21 ++- include/stdexec/__detail/__schedule_from.hpp | 23 +++- include/stdexec/__detail/__schedulers.hpp | 43 +++--- .../__detail/__sender_adaptor_closure.hpp | 23 +++- .../stdexec/__detail/__sender_concepts.hpp | 41 +++--- include/stdexec/__detail/__senders.hpp | 21 ++- include/stdexec/execution.hpp | 126 ++++++++++-------- test/CMakeLists.txt | 5 +- test/stdexec/algos/factories/test_just.cpp | 4 +- 13 files changed, 276 insertions(+), 173 deletions(-) diff --git a/include/stdexec/__detail/__bulk.hpp b/include/stdexec/__detail/__bulk.hpp index 0da2eeb30..bd1384e7e 100644 --- a/include/stdexec/__detail/__bulk.hpp +++ b/include/stdexec/__detail/__bulk.hpp @@ -15,19 +15,27 @@ */ #pragma once -#include "__execution_fwd.hpp" +#include "__config.hpp" + +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) + +import stdexec; + +#else + +# include "__execution_fwd.hpp" // include these after __execution_fwd.hpp -#include "__basic_sender.hpp" -#include "__completion_signatures_of.hpp" -#include "__diagnostics.hpp" -#include "__execution_legacy.hpp" // IWYU pragma: export -#include "__meta.hpp" -#include "__sender_adaptor_closure.hpp" -#include "__senders.hpp" // IWYU pragma: keep for __well_formed_sender -#include "__transform_completion_signatures.hpp" +# include "__basic_sender.hpp" +# include "__completion_signatures_of.hpp" +# include "__diagnostics.hpp" +# include "__execution_legacy.hpp" // IWYU pragma: export +# include "__meta.hpp" +# include "__sender_adaptor_closure.hpp" +# include "__senders.hpp" // IWYU pragma: keep for __well_formed_sender +# include "__transform_completion_signatures.hpp" -#include "__prologue.hpp" +# include "__prologue.hpp" STDEXEC_PRAGMA_IGNORE_GNU("-Wmissing-braces") @@ -577,4 +585,5 @@ namespace STDEXEC {}; } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/__detail/__completion_signatures_of.hpp b/include/stdexec/__detail/__completion_signatures_of.hpp index c09b281c8..368a20022 100644 --- a/include/stdexec/__detail/__completion_signatures_of.hpp +++ b/include/stdexec/__detail/__completion_signatures_of.hpp @@ -15,18 +15,26 @@ */ #pragma once -#include "__execution_fwd.hpp" +#include "__config.hpp" + +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) + +import stdexec; + +#else + +# include "__execution_fwd.hpp" // include these after __execution_fwd.hpp -#include "__debug.hpp" // IWYU pragma: keep for STDEXEC::__debug_sender -#include "__get_completion_signatures.hpp" -#include "__sender_concepts.hpp" // IWYU pragma: export +# include "__debug.hpp" // IWYU pragma: keep for STDEXEC::__debug_sender +# include "__get_completion_signatures.hpp" +# include "__sender_concepts.hpp" // IWYU pragma: export -#include "__prologue.hpp" +# include "__prologue.hpp" namespace STDEXEC { -#if STDEXEC_ENABLE_EXTRA_TYPE_CHECKING() +# if STDEXEC_ENABLE_EXTRA_TYPE_CHECKING() // __checked_completion_signatures is for catching logic bugs in a sender's metadata. If sender // and sender_in are both true, then they had better report the same metadata. This // completion signatures wrapper enforces that at compile time. @@ -43,11 +51,12 @@ namespace STDEXEC using completion_signatures_of_t = decltype(STDEXEC::__checked_completion_signatures(__declval<_CvSender>(), __declval<_Env>()...)); -#else +# else template requires sender_in<_CvSender, _Env...> using completion_signatures_of_t = __completion_signatures_of_t<_CvSender, _Env...>; -#endif +# endif } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/__detail/__connect.hpp b/include/stdexec/__detail/__connect.hpp index 9fcde6b5d..7f57323bf 100644 --- a/include/stdexec/__detail/__connect.hpp +++ b/include/stdexec/__detail/__connect.hpp @@ -15,16 +15,24 @@ */ #pragma once -#include "__execution_fwd.hpp" +#include "__config.hpp" + +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) + +import stdexec; + +#else + +# include "__execution_fwd.hpp" // include these after __execution_fwd.hpp -#include "__completion_signatures_of.hpp" -#include "__connect_awaitable.hpp" -#include "__tag_invoke.hpp" -#include "__transform_sender.hpp" -#include "__type_traits.hpp" +# include "__completion_signatures_of.hpp" +# include "__connect_awaitable.hpp" +# include "__tag_invoke.hpp" +# include "__transform_sender.hpp" +# include "__type_traits.hpp" -#include "__prologue.hpp" +# include "__prologue.hpp" namespace STDEXEC { @@ -56,9 +64,9 @@ namespace STDEXEC || __with_co_await<_Sender, _Receiver> || __with_legacy_tag_invoke<_Sender, _Receiver>; -#if !STDEXEC_MSVC() +# if !STDEXEC_MSVC() -# define STDEXEC_CONNECT_DECLFN_FOR(_EXPR) __declfn_t +# define STDEXEC_CONNECT_DECLFN_FOR(_EXPR) __declfn_t // A variable template whose type is a function pointer such that the // return type and noexcept-ness depend on whether _Sender can be connected @@ -131,11 +139,11 @@ namespace STDEXEC _Receiver, __nothrow_callable>>); -# undef STDEXEC_CONNECT_DECLFN_FOR +# undef STDEXEC_CONNECT_DECLFN_FOR -#else // ^^^ !STDEXEC_MSVC() ^^^ / vvv STDEXEC_MSVC() vvv +# else // ^^^ !STDEXEC_MSVC() ^^^ / vvv STDEXEC_MSVC() vvv -# define STDEXEC_CONNECT_DECLFN_FOR(_EXPR) __declfn() +# define STDEXEC_CONNECT_DECLFN_FOR(_EXPR) __declfn() template struct __connect_declfn; @@ -212,9 +220,9 @@ namespace STDEXEC template __get>, _Receiver>()); -# undef STDEXEC_CONNECT_DECLFN_FOR +# undef STDEXEC_CONNECT_DECLFN_FOR -#endif // STDEXEC_MSVC() +# endif // STDEXEC_MSVC() } // namespace __connect template @@ -371,4 +379,5 @@ namespace STDEXEC } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/__detail/__continues_on.hpp b/include/stdexec/__detail/__continues_on.hpp index d9fb2866b..dda3f1840 100644 --- a/include/stdexec/__detail/__continues_on.hpp +++ b/include/stdexec/__detail/__continues_on.hpp @@ -15,24 +15,32 @@ */ #pragma once -#include "__execution_fwd.hpp" +#include "__config.hpp" + +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) + +import stdexec; + +#else + +# include "__execution_fwd.hpp" // include these after __execution_fwd.hpp -#include "__basic_sender.hpp" -#include "__concepts.hpp" -#include "__env.hpp" -#include "__meta.hpp" -#include "__operation_states.hpp" -#include "__schedule_from.hpp" -#include "__schedulers.hpp" -#include "__sender_adaptor_closure.hpp" -#include "__senders.hpp" -#include "__storage.hpp" -#include "__transform_completion_signatures.hpp" -#include "__tuple.hpp" -#include "__utility.hpp" - -#include "__prologue.hpp" +# include "__basic_sender.hpp" +# include "__concepts.hpp" +# include "__env.hpp" +# include "__meta.hpp" +# include "__operation_states.hpp" +# include "__schedule_from.hpp" +# include "__schedulers.hpp" +# include "__sender_adaptor_closure.hpp" +# include "__senders.hpp" +# include "__storage.hpp" +# include "__transform_completion_signatures.hpp" +# include "__tuple.hpp" +# include "__utility.hpp" + +# include "__prologue.hpp" namespace STDEXEC { @@ -446,7 +454,7 @@ namespace STDEXEC //! **Example.** //! //! @code{.cpp} - //! #include + //! # include //! //! int main() { //! using namespace stdexec; @@ -527,4 +535,5 @@ namespace STDEXEC {}; } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/__detail/__inline_scheduler.hpp b/include/stdexec/__detail/__inline_scheduler.hpp index fd2176a5e..acd93fae8 100644 --- a/include/stdexec/__detail/__inline_scheduler.hpp +++ b/include/stdexec/__detail/__inline_scheduler.hpp @@ -15,13 +15,21 @@ */ #pragma once -#include "__execution_fwd.hpp" +#include "__config.hpp" -#include "__completion_behavior.hpp" -#include "__receivers.hpp" -#include "__schedulers.hpp" +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) -#include "__prologue.hpp" +import stdexec; + +#else + +# include "__execution_fwd.hpp" + +# include "__completion_behavior.hpp" +# include "__receivers.hpp" +# include "__schedulers.hpp" + +# include "__prologue.hpp" namespace STDEXEC { @@ -88,4 +96,5 @@ namespace STDEXEC static_assert(__completes_inline>>); } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/__detail/__schedule_from.hpp b/include/stdexec/__detail/__schedule_from.hpp index 242425946..6db2166c2 100644 --- a/include/stdexec/__detail/__schedule_from.hpp +++ b/include/stdexec/__detail/__schedule_from.hpp @@ -15,15 +15,23 @@ */ #pragma once -#include "__execution_fwd.hpp" +#include "__config.hpp" + +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) + +import stdexec; + +#else + +# include "__execution_fwd.hpp" // include these after __execution_fwd.hpp -#include "__basic_sender.hpp" -#include "__completion_signatures_of.hpp" -#include "__queries.hpp" -#include "__sender_introspection.hpp" +# include "__basic_sender.hpp" +# include "__completion_signatures_of.hpp" +# include "__queries.hpp" +# include "__sender_introspection.hpp" -#include "__prologue.hpp" +# include "__prologue.hpp" namespace STDEXEC { @@ -58,4 +66,5 @@ namespace STDEXEC }; } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/__detail/__schedulers.hpp b/include/stdexec/__detail/__schedulers.hpp index d019455da..f912e4053 100644 --- a/include/stdexec/__detail/__schedulers.hpp +++ b/include/stdexec/__detail/__schedulers.hpp @@ -15,20 +15,28 @@ */ #pragma once -#include "__execution_fwd.hpp" - -// include these after __execution_fwd.hpp -#include "__completion_signatures_of.hpp" // IWYU pragma: keep for the sender concept -#include "__concepts.hpp" #include "__config.hpp" -#include "__domain.hpp" -#include "__env.hpp" -#include "__query.hpp" -#include "__sender_concepts.hpp" -#include "__type_traits.hpp" -#include "__utility.hpp" -#include "__prologue.hpp" +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) + +import stdexec; + +#else + +# include "__execution_fwd.hpp" + +// include these after __execution_fwd.hpp +# include "__completion_signatures_of.hpp" // IWYU pragma: keep for the sender concept +# include "__concepts.hpp" +# include "__config.hpp" +# include "__domain.hpp" +# include "__env.hpp" +# include "__query.hpp" +# include "__sender_concepts.hpp" +# include "__type_traits.hpp" +# include "__utility.hpp" + +# include "__prologue.hpp" namespace STDEXEC { @@ -98,7 +106,7 @@ namespace STDEXEC //! **Example.** //! //! @code{.cpp} - //! #include + //! # include //! //! int main() { //! using namespace stdexec; @@ -509,10 +517,10 @@ namespace STDEXEC inline constexpr get_start_scheduler_t get_start_scheduler{}; inline constexpr get_delegation_scheduler_t get_delegation_scheduler{}; -#if !STDEXEC_GCC() || defined(__OPTIMIZE_SIZE__) +# if !STDEXEC_GCC() || defined(__OPTIMIZE_SIZE__) template <__completion_tag _Query> inline constexpr get_completion_scheduler_t<_Query> get_completion_scheduler{}; -#else +# else template <> inline constexpr get_completion_scheduler_t get_completion_scheduler{}; template <> @@ -520,7 +528,7 @@ namespace STDEXEC template <> inline constexpr get_completion_scheduler_t get_completion_scheduler{}; -#endif +# endif template requires __sends<_Tag, _Sender, _Env...> @@ -698,4 +706,5 @@ namespace STDEXEC = get_delegation_scheduler; } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/__detail/__sender_adaptor_closure.hpp b/include/stdexec/__detail/__sender_adaptor_closure.hpp index b7f2c37ba..617be1bef 100644 --- a/include/stdexec/__detail/__sender_adaptor_closure.hpp +++ b/include/stdexec/__detail/__sender_adaptor_closure.hpp @@ -15,14 +15,22 @@ */ #pragma once -#include "__execution_fwd.hpp" +#include "__config.hpp" -#include "__completion_signatures_of.hpp" -#include "__concepts.hpp" -#include "__tuple.hpp" -#include "__type_traits.hpp" +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) -#include "__prologue.hpp" +import stdexec; + +#else + +# include "__execution_fwd.hpp" + +# include "__completion_signatures_of.hpp" +# include "__concepts.hpp" +# include "__tuple.hpp" +# include "__type_traits.hpp" + +# include "__prologue.hpp" namespace STDEXEC { @@ -127,4 +135,5 @@ namespace STDEXEC STDEXEC_HOST_DEVICE_DEDUCTION_GUIDE __closure(_Fn, _As...) -> __closure<_Fn, _As...>; } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/__detail/__sender_concepts.hpp b/include/stdexec/__detail/__sender_concepts.hpp index 065e60987..735c8a7e2 100644 --- a/include/stdexec/__detail/__sender_concepts.hpp +++ b/include/stdexec/__detail/__sender_concepts.hpp @@ -15,19 +15,27 @@ */ #pragma once -#include "__execution_fwd.hpp" +#include "__config.hpp" + +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) + +import stdexec; + +#else + +# include "__execution_fwd.hpp" // include these after __execution_fwd.hpp -#include "__awaitable.hpp" -#include "__concepts.hpp" -#include "__diagnostics.hpp" -#include "__env.hpp" -#include "__get_completion_signatures.hpp" -#include "__meta.hpp" -#include "__receivers.hpp" -#include "__type_traits.hpp" +# include "__awaitable.hpp" +# include "__concepts.hpp" +# include "__diagnostics.hpp" +# include "__env.hpp" +# include "__get_completion_signatures.hpp" +# include "__meta.hpp" +# include "__receivers.hpp" +# include "__type_traits.hpp" -#include "__prologue.hpp" +# include "__prologue.hpp" namespace STDEXEC { @@ -126,15 +134,15 @@ namespace STDEXEC && __std::move_constructible<__decay_t<_Sender>> && __std::constructible_from<__decay_t<_Sender>, _Sender>; -#if STDEXEC_GCC() && STDEXEC_GCC_VERSION < 1300 +# if STDEXEC_GCC() && STDEXEC_GCC_VERSION < 1300 template inline constexpr bool __constant_completion_signatures_v = __valid_completion_signatures>; -#else +# else template inline constexpr bool __constant_completion_signatures_v = __valid_completion_signatures; -#endif +# endif //! @brief A @c sender whose *completion signatures* can be computed in a //! given environment. @@ -309,11 +317,11 @@ namespace STDEXEC static_assert(__valid_completion_signatures<_Completions>, STDEXEC_ERROR_GET_COMPLETION_SIGNATURES_HAS_INVALID_RETURN_TYPE); } -#if STDEXEC_MSVC() || STDEXEC_NVHPC() +# if STDEXEC_MSVC() || STDEXEC_NVHPC() // MSVC and NVHPC need more encouragement to print the type of the // error. _Completions __what = 0; -#endif +# endif } } } // namespace __detail @@ -329,4 +337,5 @@ namespace STDEXEC } } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/__detail/__senders.hpp b/include/stdexec/__detail/__senders.hpp index 4cac52f9e..f1bc4a95c 100644 --- a/include/stdexec/__detail/__senders.hpp +++ b/include/stdexec/__detail/__senders.hpp @@ -15,14 +15,22 @@ */ #pragma once -#include "__execution_fwd.hpp" +#include "__config.hpp" + +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) + +import stdexec; + +#else + +# include "__execution_fwd.hpp" // include these after __execution_fwd.hpp -#include "__completion_signatures.hpp" // IWYU pragma: export -#include "__connect.hpp" // IWYU pragma: export -#include "__sender_concepts.hpp" // IWYU pragma: export +# include "__completion_signatures.hpp" // IWYU pragma: export +# include "__connect.hpp" // IWYU pragma: export +# include "__sender_concepts.hpp" // IWYU pragma: export -#include "__prologue.hpp" +# include "__prologue.hpp" namespace STDEXEC { @@ -69,4 +77,5 @@ namespace STDEXEC {} } // namespace STDEXEC -#include "__epilogue.hpp" +# include "__epilogue.hpp" +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/include/stdexec/execution.hpp b/include/stdexec/execution.hpp index 9f5f6a4da..e36cef840 100644 --- a/include/stdexec/execution.hpp +++ b/include/stdexec/execution.hpp @@ -15,72 +15,82 @@ */ #pragma once -#include "__detail/__execution_fwd.hpp" +#include "__detail/__config.hpp" + +#if STDEXEC_USE_MODULES() && !defined(STDEXEC_IN_MODULE_PURVIEW) + +import stdexec; + +#else + +# include "__detail/__execution_fwd.hpp" // include these after __execution_fwd.hpp // IWYU pragma: begin_exports -#include "__detail/__as_awaitable.hpp" -#include "__detail/__associate.hpp" -#include "__detail/__basic_sender.hpp" -#include "__detail/__bulk.hpp" -#include "__detail/__completion_signatures.hpp" -#include "__detail/__connect_awaitable.hpp" -#include "__detail/__continues_on.hpp" -#include "__detail/__counting_scopes.hpp" -#include "__detail/__debug.hpp" -#include "__detail/__domain.hpp" -#include "__detail/__env.hpp" -#include "__detail/__execution_legacy.hpp" -#include "__detail/__inline_scheduler.hpp" -#include "__detail/__into_variant.hpp" -#include "__detail/__intrusive_ptr.hpp" -#include "__detail/__intrusive_slist.hpp" -#include "__detail/__just.hpp" -#include "__detail/__let.hpp" -#include "__detail/__meta.hpp" -#include "__detail/__on.hpp" -#include "__detail/__operation_states.hpp" -#include "__detail/__parallel_scheduler.hpp" -#include "__detail/__read_env.hpp" -#include "__detail/__receiver_adaptor.hpp" -#include "__detail/__receivers.hpp" -#include "__detail/__run_loop.hpp" -#include "__detail/__schedule_from.hpp" -#include "__detail/__schedulers.hpp" -#include "__detail/__scope_concepts.hpp" -#include "__detail/__sender_adaptor_closure.hpp" -#include "__detail/__senders.hpp" -#include "__detail/__spawn.hpp" -#include "__detail/__spawn_future.hpp" -#include "__detail/__starts_on.hpp" -#include "__detail/__stopped_as_error.hpp" -#include "__detail/__stopped_as_optional.hpp" -#include "__detail/__submit.hpp" -#include "__detail/__sync_wait.hpp" -#include "__detail/__task.hpp" -#include "__detail/__task_scheduler.hpp" -#include "__detail/__then.hpp" -#include "__detail/__transfer_just.hpp" -#include "__detail/__transform_completion_signatures.hpp" -#include "__detail/__transform_sender.hpp" -#include "__detail/__type_traits.hpp" -#include "__detail/__unstoppable.hpp" -#include "__detail/__upon_error.hpp" -#include "__detail/__upon_stopped.hpp" -#include "__detail/__utility.hpp" -#include "__detail/__when_all.hpp" -#include "__detail/__with_awaitable_senders.hpp" -#include "__detail/__write_env.hpp" +# include "__detail/__as_awaitable.hpp" +# include "__detail/__associate.hpp" +# include "__detail/__basic_sender.hpp" +# include "__detail/__bulk.hpp" +# include "__detail/__completion_signatures.hpp" +# include "__detail/__connect_awaitable.hpp" +# include "__detail/__continues_on.hpp" +# include "__detail/__counting_scopes.hpp" +# include "__detail/__debug.hpp" +# include "__detail/__domain.hpp" +# include "__detail/__env.hpp" +# include "__detail/__execution_legacy.hpp" +# include "__detail/__inline_scheduler.hpp" +# include "__detail/__into_variant.hpp" +# include "__detail/__intrusive_ptr.hpp" +# include "__detail/__intrusive_slist.hpp" +# include "__detail/__just.hpp" +# include "__detail/__let.hpp" +# include "__detail/__meta.hpp" +# include "__detail/__on.hpp" +# include "__detail/__operation_states.hpp" +# include "__detail/__parallel_scheduler.hpp" +# include "__detail/__read_env.hpp" +# include "__detail/__receiver_adaptor.hpp" +# include "__detail/__receivers.hpp" +# include "__detail/__run_loop.hpp" +# include "__detail/__schedule_from.hpp" +# include "__detail/__schedulers.hpp" +# include "__detail/__scope_concepts.hpp" +# include "__detail/__sender_adaptor_closure.hpp" +# include "__detail/__senders.hpp" +# include "__detail/__spawn.hpp" +# include "__detail/__spawn_future.hpp" +# include "__detail/__starts_on.hpp" +# include "__detail/__stopped_as_error.hpp" +# include "__detail/__stopped_as_optional.hpp" +# include "__detail/__submit.hpp" +# include "__detail/__sync_wait.hpp" +# include "__detail/__task.hpp" +# include "__detail/__task_scheduler.hpp" +# include "__detail/__then.hpp" +# include "__detail/__transfer_just.hpp" +# include "__detail/__transform_completion_signatures.hpp" +# include "__detail/__transform_sender.hpp" +# include "__detail/__type_traits.hpp" +# include "__detail/__unstoppable.hpp" +# include "__detail/__upon_error.hpp" +# include "__detail/__upon_stopped.hpp" +# include "__detail/__utility.hpp" +# include "__detail/__when_all.hpp" +# include "__detail/__with_awaitable_senders.hpp" +# include "__detail/__write_env.hpp" -#include "concepts.hpp" -#include "coroutine.hpp" -#include "functional.hpp" -#include "stop_token.hpp" +# include "concepts.hpp" +# include "coroutine.hpp" +# include "functional.hpp" +# include "stop_token.hpp" // IWYU pragma: end_exports -#include "__detail/__deprecations.hpp" // IWYU pragma: keep +# include "__detail/__deprecations.hpp" // IWYU pragma: keep // For issuing a meaningful diagnostic for the erroneous `snd1 | snd2`. template requires STDEXEC::__ok> auto operator|(_Ignore&&, _Sender&&) noexcept; + +#endif // !STDEXEC_USE_MODULES() || defined(STDEXEC_IN_MODULE_PURVIEW) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bf974fbc1..9cd835cf9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -117,7 +117,10 @@ target_link_libraries(common_test_settings if(STDEXEC_BUILD_MODULES) # temporarily speed up the test cycle by building only one test - add_executable(test.stdexec stdexec/module/test_module.cpp) + add_executable( + test.stdexec + stdexec/module/test_module.cpp + stdexec/algos/factories/test_just.cpp) set_target_properties(test.stdexec PROPERTIES CXX_MODULE_STD ON) else() diff --git a/test/stdexec/algos/factories/test_just.cpp b/test/stdexec/algos/factories/test_just.cpp index 8eb1ad5b1..72aeecaca 100644 --- a/test/stdexec/algos/factories/test_just.cpp +++ b/test/stdexec/algos/factories/test_just.cpp @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include -#include +//#include #include -#include #include #include #include From e44363fb3885930cd02c4d0dcf8c066e38faa57f Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Fri, 24 Jul 2026 22:40:18 -0700 Subject: [PATCH 05/20] Fix test_just.cpp Add more module exports to get `test_just.cpp` compiling and passing. --- include/stdexec/__detail/__completion_behavior.hpp | 2 +- include/stdexec/__detail/__concepts.hpp | 4 ++-- include/stdexec/__detail/__config.hpp | 9 ++++++++- include/stdexec/__detail/__domain.hpp | 4 ++-- include/stdexec/__detail/__execution_fwd.hpp | 2 +- .../stdexec/__detail/__get_completion_signatures.hpp | 7 ++++--- include/stdexec/__detail/__inline_scheduler.hpp | 2 +- include/stdexec/__detail/__meta.hpp | 12 ++++++------ include/stdexec/__detail/__sender_concepts.hpp | 2 +- include/stdexec/__detail/__sync_wait.hpp | 2 +- include/stdexec/__detail/__utility.hpp | 6 +++--- 11 files changed, 30 insertions(+), 22 deletions(-) diff --git a/include/stdexec/__detail/__completion_behavior.hpp b/include/stdexec/__detail/__completion_behavior.hpp index 63ec51330..5d914e6b1 100644 --- a/include/stdexec/__detail/__completion_behavior.hpp +++ b/include/stdexec/__detail/__completion_behavior.hpp @@ -208,7 +208,7 @@ namespace STDEXEC inline constexpr auto __completion_behavior_of_v = __call_result_t<__get_completion_behavior_t<_Tag>, _Attrs const &, _Env const &...>{}; - template + STDEXEC_MODULE_EXPORT_AUTHORING template concept __completes_inline = (__completion_behavior_of_v<_Tag, _Attrs, _Env...>.value == __completion_behavior::__inline_completion); diff --git a/include/stdexec/__detail/__concepts.hpp b/include/stdexec/__detail/__concepts.hpp index 6bcebcf82..86ca7dfa0 100644 --- a/include/stdexec/__detail/__concepts.hpp +++ b/include/stdexec/__detail/__concepts.hpp @@ -87,7 +87,7 @@ namespace STDEXEC template concept __class = __true && (!__same_as<_Cp const, _Cp>); - template + STDEXEC_MODULE_EXPORT_META template concept __one_of = (__same_as<_Ty, _As> || ...); template @@ -306,7 +306,7 @@ namespace STDEXEC template concept __nothrow_move_constructible = (__nothrow_constructible_from<_Ts, _Ts> && ...); - template + STDEXEC_MODULE_EXPORT_META template concept __nothrow_copy_constructible = (__nothrow_constructible_from<_Ts, _Ts const &> && ...); template diff --git a/include/stdexec/__detail/__config.hpp b/include/stdexec/__detail/__config.hpp index 5aad8b496..92ad15b47 100644 --- a/include/stdexec/__detail/__config.hpp +++ b/include/stdexec/__detail/__config.hpp @@ -957,4 +957,11 @@ namespace STDEXEC # define STDEXEC_MODULE_EXPORT #endif -STDEXEC_MODULE_EXPORT namespace STDEXEC {} +// Placeholder until stdexec.meta / stdexec.authoring exist as separate +// modules; these currently just export into stdexec itself. See #2139 +// (https://github.com/NVIDIA/stdexec/issues/2139) +#define STDEXEC_MODULE_EXPORT_META STDEXEC_MODULE_EXPORT +#define STDEXEC_MODULE_EXPORT_AUTHORING STDEXEC_MODULE_EXPORT + +STDEXEC_MODULE_EXPORT namespace STDEXEC +{} diff --git a/include/stdexec/__detail/__domain.hpp b/include/stdexec/__detail/__domain.hpp index 539b9055c..54fa9232a 100644 --- a/include/stdexec/__detail/__domain.hpp +++ b/include/stdexec/__detail/__domain.hpp @@ -180,7 +180,7 @@ namespace STDEXEC } // namespace __detail //////////////////////////////////////////////////////////////////////////////////////////////// - template + STDEXEC_MODULE_EXPORT_AUTHORING template requires __sends<_Tag, _Sender, _Env...> using __completion_domain_of_t = __completion_domain_t<_Tag, env_of_t<_Sender>, _Env const &...>; @@ -407,7 +407,7 @@ namespace STDEXEC } }; - template + STDEXEC_MODULE_EXPORT_AUTHORING template concept __has_completion_domain_for = __sends<_Tag, _Sender, _Env...> && __callable, env_of_t<_Sender>, _Env const &...>; diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index 691bdebe2..10750d375 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -93,7 +93,7 @@ namespace STDEXEC constexpr auto __invalid_disposition = static_cast<__disposition>(3); // invalid value - template + STDEXEC_MODULE_EXPORT_AUTHORING template concept __completion_tag = __one_of<_Tag, set_value_t, set_error_t, set_stopped_t>; STDEXEC_MODULE_EXPORT template diff --git a/include/stdexec/__detail/__get_completion_signatures.hpp b/include/stdexec/__detail/__get_completion_signatures.hpp index 2b0ecda65..c120018b4 100644 --- a/include/stdexec/__detail/__get_completion_signatures.hpp +++ b/include/stdexec/__detail/__get_completion_signatures.hpp @@ -486,7 +486,7 @@ namespace STDEXEC using __value_types_of_t = __value_types_t<__completion_signatures_of_t<_Sender, _Env>, _Tuple, _Variant>; - template , template class _Tuple = __decayed_std_tuple, template class _Variant = __std_variant> @@ -500,16 +500,17 @@ namespace STDEXEC using __error_types_of_t = __error_types_t<__completion_signatures_of_t<_Sender, _Env>, _Variant, _Transform>; + STDEXEC_MODULE_EXPORT template , template class _Variant = __std_variant> using error_types_of_t = __error_types_t<__completion_signatures_of_t<_Sender, _Env>, __q<_Variant>>; - template + STDEXEC_MODULE_EXPORT template requires __valid_completion_signatures<__completion_signatures_of_t<_Sender, _Env...>> inline constexpr bool sends_stopped = __sends_stopped<__completion_signatures_of_t<_Sender, _Env...>>; - template + STDEXEC_MODULE_EXPORT_AUTHORING template using __count_of = __msize_t<__detail::__count_of<_Tag, __completion_signatures_of_t<_Sender, _Env...>>>; diff --git a/include/stdexec/__detail/__inline_scheduler.hpp b/include/stdexec/__detail/__inline_scheduler.hpp index acd93fae8..2efb61fef 100644 --- a/include/stdexec/__detail/__inline_scheduler.hpp +++ b/include/stdexec/__detail/__inline_scheduler.hpp @@ -43,7 +43,7 @@ namespace STDEXEC constexpr auto operator==(__inline_attrs const &) const noexcept -> bool = default; }; - struct inline_scheduler : __inline_attrs + STDEXEC_MODULE_EXPORT struct inline_scheduler : __inline_attrs { private: template diff --git a/include/stdexec/__detail/__meta.hpp b/include/stdexec/__detail/__meta.hpp index 38fbfb0aa..5961a5261 100644 --- a/include/stdexec/__detail/__meta.hpp +++ b/include/stdexec/__detail/__meta.hpp @@ -594,7 +594,7 @@ namespace STDEXEC using __f = _ERROR_<_What...>; }; - template + STDEXEC_MODULE_EXPORT_META template using __mapply = __mcall1<__mfor<_List>, _Fn>; template