From 1d3fa63ecddf7188c21fb0e81c8419a03eb14c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Fri, 6 Feb 2026 23:58:34 +0000 Subject: [PATCH 01/18] change all tests to use modules via a module exposition details --- .../execution/detail/simple_allocator.hpp | 2 +- src/beman/execution/CMakeLists.txt | 6 +- src/beman/execution/execution-detail.cppm | 187 ++++++++++++++++++ src/beman/execution/execution.cppm | 13 +- .../allocator-requirements-general.test.cpp | 8 +- tests/beman/execution/exec-awaitable.test.cpp | 14 +- tests/beman/execution/exec-bulk.test.cpp | 2 +- tests/beman/execution/exec-connect.test.cpp | 14 +- .../execution/exec-continues-on.test.cpp | 9 +- .../execution/exec-domain-default.test.cpp | 9 +- tests/beman/execution/exec-env.test.cpp | 4 +- tests/beman/execution/exec-fwd-env.test.cpp | 2 +- tests/beman/execution/exec-general.test.cpp | 9 +- .../execution/exec-get-allocator.test.cpp | 1 + .../exec-get-delegation-scheduler.test.cpp | 2 +- .../beman/execution/exec-get-domain.test.cpp | 2 +- tests/beman/execution/exec-get-env.test.cpp | 2 +- .../execution/exec-get-scheduler.test.cpp | 2 +- .../execution/exec-get-stop-token.test.cpp | 2 +- .../execution/exec-getcomplsigs.test.cpp | 2 +- .../execution/exec-into-variant.test.cpp | 2 +- tests/beman/execution/exec-just.test.cpp | 17 +- tests/beman/execution/exec-let.test.cpp | 2 +- tests/beman/execution/exec-on.test.cpp | 20 +- .../execution/exec-opstate-start.test.cpp | 2 +- tests/beman/execution/exec-prop.test.cpp | 2 +- tests/beman/execution/exec-read-env.test.cpp | 2 +- .../execution/exec-recv-concepts.test.cpp | 7 +- tests/beman/execution/exec-recv.test.cpp | 7 +- .../execution/exec-run-loop-general.test.cpp | 2 +- .../execution/exec-run-loop-types.test.cpp | 2 +- .../execution/exec-schedule-from.test.cpp | 2 +- tests/beman/execution/exec-schedule.test.cpp | 2 +- .../execution/exec-scope-concepts.test.cpp | 2 +- .../execution/exec-scope-counting.test.cpp | 2 +- .../exec-scope-simple-counting.test.cpp | 2 +- tests/beman/execution/exec-set-error.test.cpp | 2 +- .../beman/execution/exec-set-stopped.test.cpp | 2 +- tests/beman/execution/exec-set-value.test.cpp | 2 +- tests/beman/execution/exec-snd-apply.test.cpp | 2 +- .../execution/exec-snd-concepts.test.cpp | 16 +- tests/beman/execution/exec-snd-expos.test.cpp | 11 +- .../execution/exec-snd-transform.test.cpp | 2 +- .../execution/exec-spawn-future.test.cpp | 11 +- tests/beman/execution/exec-spawn.test.cpp | 15 +- tests/beman/execution/exec-split.test.cpp | 15 +- tests/beman/execution/exec-starts-on.test.cpp | 2 +- tests/beman/execution/exec-stop-when.test.cpp | 15 +- tests/beman/execution/exec-sync-wait.test.cpp | 3 +- tests/beman/execution/exec-then.test.cpp | 2 +- .../execution/exec-utils-cmplsigs.test.cpp | 12 +- tests/beman/execution/exec-when-all.test.cpp | 2 +- .../exec-with-awaitable-senders.test.cpp | 2 +- .../execution-queryable-concept.test.cpp | 7 +- tests/beman/execution/execution-syn.test.cpp | 10 +- tests/beman/execution/forward-like.test.cpp | 7 +- tests/beman/execution/functional-syn.test.cpp | 9 +- .../execution/include/test/thread_pool.hpp | 15 +- tests/beman/execution/issue-174.test.cpp | 2 +- tests/beman/execution/meta-combine.test.cpp | 8 +- tests/beman/execution/meta-contains.test.cpp | 6 +- tests/beman/execution/meta-filter.test.cpp | 8 +- tests/beman/execution/meta-prepend.test.cpp | 8 +- tests/beman/execution/meta-transform.test.cpp | 10 +- tests/beman/execution/meta-unique.test.cpp | 8 +- tests/beman/execution/non_assignable.test.cpp | 6 +- tests/beman/execution/notify.test.cpp | 9 +- .../execution/stopcallback-cons.test.cpp | 2 +- .../execution/stopcallback-general.test.cpp | 2 +- .../stopcallback-inplace-cons.test.cpp | 2 +- .../stopcallback-inplace-general.test.cpp | 2 +- .../beman/execution/stopsource-cons.test.cpp | 2 +- .../stopsource-inplace-cons.test.cpp | 2 +- .../stopsource-inplace-general.test.cpp | 1 + tests/beman/execution/stopsource.test.cpp | 2 +- .../execution/stoptoken-concepts.test.cpp | 5 + .../stoptoken-inplace-general.test.cpp | 2 +- .../execution/thread-stoptoken-intro.test.cpp | 8 +- .../thread-stoptoken-syn.compile.test.cpp | 5 + 79 files changed, 492 insertions(+), 139 deletions(-) create mode 100644 src/beman/execution/execution-detail.cppm diff --git a/include/beman/execution/detail/simple_allocator.hpp b/include/beman/execution/detail/simple_allocator.hpp index ca806273..90bde1c0 100644 --- a/include/beman/execution/detail/simple_allocator.hpp +++ b/include/beman/execution/detail/simple_allocator.hpp @@ -11,7 +11,7 @@ // ---------------------------------------------------------------------------- namespace beman::execution::detail { -template //-dk:TODO detail export +template concept simple_allocator = requires(::std::remove_cvref_t alloc, ::std::size_t n) { { *alloc.allocate(n) } -> ::std::same_as::value_type&>; diff --git a/src/beman/execution/CMakeLists.txt b/src/beman/execution/CMakeLists.txt index 29f6c1c8..a4abba4b 100644 --- a/src/beman/execution/CMakeLists.txt +++ b/src/beman/execution/CMakeLists.txt @@ -201,8 +201,10 @@ if(BEMAN_USE_MODULES) execution.cpp # TODO(CK): check if really needed! PUBLIC FILE_SET CXX_MODULES - BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} - FILES execution.cppm + BASE_DIRS ${PROJECT_SOURCE_DIR}/src/beman/execution + FILES + ${PROJECT_SOURCE_DIR}/src/beman/execution/execution.cppm + ${PROJECT_SOURCE_DIR}/src/beman/execution/execution-detail.cppm ) target_link_libraries(${TARGET_PREFIX} PUBLIC ${TARGET_NAME}) endif() diff --git a/src/beman/execution/execution-detail.cppm b/src/beman/execution/execution-detail.cppm new file mode 100644 index 00000000..9fe407eb --- /dev/null +++ b/src/beman/execution/execution-detail.cppm @@ -0,0 +1,187 @@ +module; +// src/beman/execution/execution-detail.cppm -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +export module beman.execution.detail; + +namespace beman::execution::detail::meta { +export using beman::execution::detail::meta::combine; +export using beman::execution::detail::meta::contain_same; +export using beman::execution::detail::meta::contains; +export using beman::execution::detail::meta::filter; +export using beman::execution::detail::meta::prepend; +export using beman::execution::detail::meta::transform; +export using beman::execution::detail::meta::unique; +} // namespace beman::execution::detail::meta + +namespace beman::execution::detail { +export using beman::execution::detail::always_true; +export using beman::execution::detail::as_except_ptr; +export using beman::execution::detail::await_suspend_result; +export using beman::execution::detail::basic_operation; +export using beman::execution::detail::basic_receiver; +export using beman::execution::detail::basic_sender; +export using beman::execution::detail::basic_state; +export using beman::execution::detail::call_result_t; +export using beman::execution::detail::callable; +export using beman::execution::detail::child_type; +export using beman::execution::detail::completion_domain; +export using beman::execution::detail::completion_signature; +export using beman::execution::detail::completion_signatures_for; +export using beman::execution::detail::completion_signatures_for_impl; +export using beman::execution::detail::completion_tag; +export using beman::execution::detail::connect_all; +export using beman::execution::detail::connect_all_result; +export using beman::execution::detail::connect_awaitable; +export using beman::execution::detail::connect_awaitable_promise; +export using beman::execution::detail::decayed_tuple; +export using beman::execution::detail::decayed_typeof; +export using beman::execution::detail::decays_to; +export using beman::execution::detail::default_impls; +export using beman::execution::detail::empty_variant; +export using beman::execution::detail::enable_sender; +export using beman::execution::detail::env_type; +export using beman::execution::detail::forward_like; +export using beman::execution::detail::fwd_env; +export using beman::execution::detail::gather_signatures; +export using beman::execution::detail::get_awaiter; +export using beman::execution::detail::get_domain_early; +export using beman::execution::detail::get_domain_late; +export using beman::execution::detail::get_sender_data; +export using beman::execution::detail::has_as_awaitable; +export using beman::execution::detail::has_completions; +export using beman::execution::detail::immovable; +export using beman::execution::detail::impls_for; +export using beman::execution::detail::indices_for; +export using beman::execution::detail::indirect_meta_apply; +export using beman::execution::detail::is_awaitable; +export using beman::execution::detail::is_awaiter; +export using beman::execution::detail::is_product_type; +export using beman::execution::detail::is_sender; +export using beman::execution::detail::is_sender_adaptor_closure; +export using beman::execution::detail::join_env; +export using beman::execution::detail::make_env; +export using beman::execution::detail::make_sender; +export using beman::execution::detail::matching_sig; +export using beman::execution::detail::movable_value; +export using beman::execution::detail::no_completion_signatures_defined_in_sender; +export using beman::execution::detail::non_assignable; +export using beman::execution::detail::nothrow_callable; +export using beman::execution::detail::notifier; +export using beman::execution::detail::notify; +export using beman::execution::detail::notify_t; +export using beman::execution::detail::operation_state_task; +export using beman::execution::detail::own_forward_like; +export using beman::execution::detail::product_type; +export using beman::execution::detail::query_with_default; +export using beman::execution::detail::queryable; +export using beman::execution::detail::sched_attrs; +export using beman::execution::detail::sched_env; +export using beman::execution::detail::sender_adaptor; +export using beman::execution::detail::sender_for; +export using beman::execution::detail::simple_allocator; +export using beman::execution::detail::single_sender; +export using beman::execution::detail::single_sender_value_type; +export using beman::execution::detail::spawn_future_receiver; +export using beman::execution::detail::spawn_future_state_base; +export using beman::execution::detail::spawn_get_allocator; +export using beman::execution::detail::spawn_t; +export using beman::execution::detail::state_type; +export using beman::execution::detail::stop_when; +export using beman::execution::detail::stop_when_t; +export using beman::execution::detail::stoppable_callback_for; +export using beman::execution::detail::stoppable_source; +export using beman::execution::detail::suspend_complete; +export using beman::execution::detail::sync_wait_env; +export using beman::execution::detail::sync_wait_receiver; +export using beman::execution::detail::sync_wait_result_type; +export using beman::execution::detail::sync_wait_state; +export using beman::execution::detail::type_list; +export using beman::execution::detail::valid_completion_for; +export using beman::execution::detail::valid_completion_signatures; +export using beman::execution::detail::valid_specialization; +export using beman::execution::detail::variant_or_empty; +export using beman::execution::detail::with_await_transform; +export using beman::execution::detail::write_env; +export using beman::execution::detail::write_env_t; + +} // namespace beman::execution::detail diff --git a/src/beman/execution/execution.cppm b/src/beman/execution/execution.cppm index c790bfbc..5031b71b 100644 --- a/src/beman/execution/execution.cppm +++ b/src/beman/execution/execution.cppm @@ -240,19 +240,18 @@ export using ::beman::execution::spawn; export using ::beman::execution::spawn_future; namespace detail { +export using ::beman::execution::detail::await_result_type; export using ::beman::execution::detail::basic_sender; +export using ::beman::execution::detail::connect_all; +export using ::beman::execution::detail::connect_all_t; +export using ::beman::execution::detail::env_promise; +export using ::beman::execution::detail::is_product_type_c; export using ::beman::execution::detail::product_type; export using ::beman::execution::detail::product_type_base; -export using ::beman::execution::detail::is_product_type_c; -export using ::beman::execution::detail::env_promise; -export using ::beman::execution::detail::await_result_type; -export using ::beman::execution::detail::simple_allocator; export using ::beman::execution::detail::sync_wait_env; +export using ::beman::execution::detail::sync_wait_receiver; export using ::beman::execution::detail::sync_wait_result_type; export using ::beman::execution::detail::sync_wait_state; -export using ::beman::execution::detail::sync_wait_receiver; -export using ::beman::execution::detail::connect_all_t; -export using ::beman::execution::detail::connect_all; } // namespace detail } // namespace beman::execution diff --git a/tests/beman/execution/allocator-requirements-general.test.cpp b/tests/beman/execution/allocator-requirements-general.test.cpp index 60574a56..e8bfcfc2 100644 --- a/tests/beman/execution/allocator-requirements-general.test.cpp +++ b/tests/beman/execution/allocator-requirements-general.test.cpp @@ -1,8 +1,12 @@ // src/beman/execution/tests/allocator-requirements-general.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- @@ -72,7 +76,7 @@ struct not_copy_constructible { auto operator=(not_copy_constructible&&) -> not_copy_constructible = delete; auto operator=(const not_copy_constructible&) -> not_copy_constructible = delete; auto allocate(::std::size_t n) -> int* { return new int[n]; } - auto deallocate(/*long*/ int*, ::std::size_t) -> void {} + auto deallocate(int*, ::std::size_t) -> void {} auto operator==(const not_copy_constructible&) const -> bool = default; }; diff --git a/tests/beman/execution/exec-awaitable.test.cpp b/tests/beman/execution/exec-awaitable.test.cpp index 184e0f3c..8410614f 100644 --- a/tests/beman/execution/exec-awaitable.test.cpp +++ b/tests/beman/execution/exec-awaitable.test.cpp @@ -2,20 +2,22 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // #include -#include -#include -#include #include #include +#include #include #ifdef BEMAN_HAS_MODULES import beman.execution; +import beman.execution.detail; #else -#include #include -#include +#include #include -#include +#include +#include +#include +#include +#include #endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-bulk.test.cpp b/tests/beman/execution/exec-bulk.test.cpp index fe07c772..655adb33 100644 --- a/tests/beman/execution/exec-bulk.test.cpp +++ b/tests/beman/execution/exec-bulk.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/exec-bulk.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-connect.test.cpp b/tests/beman/execution/exec-connect.test.cpp index 234a5622..d440d684 100644 --- a/tests/beman/execution/exec-connect.test.cpp +++ b/tests/beman/execution/exec-connect.test.cpp @@ -1,15 +1,21 @@ // src/beman/execution/tests/exec-connect.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include #include #include -#include - -#include -#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-continues-on.test.cpp b/tests/beman/execution/exec-continues-on.test.cpp index b743a03f..70c5b733 100644 --- a/tests/beman/execution/exec-continues-on.test.cpp +++ b/tests/beman/execution/exec-continues-on.test.cpp @@ -1,11 +1,16 @@ // src/beman/execution/tests/exec-continues-on.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include -#include -#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-domain-default.test.cpp b/tests/beman/execution/exec-domain-default.test.cpp index 9becf75f..f9ae8657 100644 --- a/tests/beman/execution/exec-domain-default.test.cpp +++ b/tests/beman/execution/exec-domain-default.test.cpp @@ -1,12 +1,17 @@ // src/beman/execution/tests/exec-domain-default.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include #include -#include -#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-env.test.cpp b/tests/beman/execution/exec-env.test.cpp index 40c9b9d8..2cb8f4fd 100644 --- a/tests/beman/execution/exec-env.test.cpp +++ b/tests/beman/execution/exec-env.test.cpp @@ -1,9 +1,9 @@ // tests/beman/execution/exec-env.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else @@ -14,8 +14,6 @@ import beman.execution; #include #endif -namespace {} - // ---------------------------------------------------------------------------- TEST(env) { diff --git a/tests/beman/execution/exec-fwd-env.test.cpp b/tests/beman/execution/exec-fwd-env.test.cpp index 72a0860b..64dc9682 100644 --- a/tests/beman/execution/exec-fwd-env.test.cpp +++ b/tests/beman/execution/exec-fwd-env.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-fwd-env.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-general.test.cpp b/tests/beman/execution/exec-general.test.cpp index 05d5bb5c..a6132435 100644 --- a/tests/beman/execution/exec-general.test.cpp +++ b/tests/beman/execution/exec-general.test.cpp @@ -1,17 +1,18 @@ // src/beman/execution/tests/exec-general.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include -#include -#include #include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; +import beman.execution.detail; #else #include +#include +#include +#include #endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-get-allocator.test.cpp b/tests/beman/execution/exec-get-allocator.test.cpp index 89608040..a87131f4 100644 --- a/tests/beman/execution/exec-get-allocator.test.cpp +++ b/tests/beman/execution/exec-get-allocator.test.cpp @@ -5,6 +5,7 @@ #include #ifdef BEMAN_HAS_MODULES import beman.execution; +import beman.execution.detail; #else #include #endif diff --git a/tests/beman/execution/exec-get-delegation-scheduler.test.cpp b/tests/beman/execution/exec-get-delegation-scheduler.test.cpp index 22fffb5f..28070232 100644 --- a/tests/beman/execution/exec-get-delegation-scheduler.test.cpp +++ b/tests/beman/execution/exec-get-delegation-scheduler.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-get-delegation-scheduler.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-get-domain.test.cpp b/tests/beman/execution/exec-get-domain.test.cpp index 89c10c3d..759e3231 100644 --- a/tests/beman/execution/exec-get-domain.test.cpp +++ b/tests/beman/execution/exec-get-domain.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-get-domain.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-get-env.test.cpp b/tests/beman/execution/exec-get-env.test.cpp index feb1b61a..4b796ce5 100644 --- a/tests/beman/execution/exec-get-env.test.cpp +++ b/tests/beman/execution/exec-get-env.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/exec-get-env.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-get-scheduler.test.cpp b/tests/beman/execution/exec-get-scheduler.test.cpp index b4c54c8d..e71575cf 100644 --- a/tests/beman/execution/exec-get-scheduler.test.cpp +++ b/tests/beman/execution/exec-get-scheduler.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-get-scheduler.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-get-stop-token.test.cpp b/tests/beman/execution/exec-get-stop-token.test.cpp index 52c8d0e9..27da8d80 100644 --- a/tests/beman/execution/exec-get-stop-token.test.cpp +++ b/tests/beman/execution/exec-get-stop-token.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-get-stop-token.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-getcomplsigs.test.cpp b/tests/beman/execution/exec-getcomplsigs.test.cpp index 5cfd2515..5c294f65 100644 --- a/tests/beman/execution/exec-getcomplsigs.test.cpp +++ b/tests/beman/execution/exec-getcomplsigs.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-getcomplsigs.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-into-variant.test.cpp b/tests/beman/execution/exec-into-variant.test.cpp index 915eb643..48b1472e 100644 --- a/tests/beman/execution/exec-into-variant.test.cpp +++ b/tests/beman/execution/exec-into-variant.test.cpp @@ -1,11 +1,11 @@ // src/beman/execution/tests/exec-into-variant.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-just.test.cpp b/tests/beman/execution/exec-just.test.cpp index d0dc293d..b13959af 100644 --- a/tests/beman/execution/exec-just.test.cpp +++ b/tests/beman/execution/exec-just.test.cpp @@ -1,16 +1,23 @@ // src/beman/execution/tests/exec-just.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include +#include +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else +#include #include +#include +#include #include #include #include -#include -#include -#include - #include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-let.test.cpp b/tests/beman/execution/exec-let.test.cpp index a0be5e79..e7ffa3ff 100644 --- a/tests/beman/execution/exec-let.test.cpp +++ b/tests/beman/execution/exec-let.test.cpp @@ -1,13 +1,13 @@ // src/beman/execution/tests/exec-let.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include #include #include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-on.test.cpp b/tests/beman/execution/exec-on.test.cpp index e3e5b421..5c3ee4c9 100644 --- a/tests/beman/execution/exec-on.test.cpp +++ b/tests/beman/execution/exec-on.test.cpp @@ -1,17 +1,25 @@ // tests/beman/execution/exec-on.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else +#include #include +#include +#include +#include #include -#include +#include #include -#include -#include -#include -#include +#include #include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-opstate-start.test.cpp b/tests/beman/execution/exec-opstate-start.test.cpp index 681a0e4e..ab9bdded 100644 --- a/tests/beman/execution/exec-opstate-start.test.cpp +++ b/tests/beman/execution/exec-opstate-start.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-opstate-start.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-prop.test.cpp b/tests/beman/execution/exec-prop.test.cpp index e3920cf3..40810315 100644 --- a/tests/beman/execution/exec-prop.test.cpp +++ b/tests/beman/execution/exec-prop.test.cpp @@ -1,9 +1,9 @@ // tests/beman/execution/exec-prop.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-read-env.test.cpp b/tests/beman/execution/exec-read-env.test.cpp index 5748a67a..fe5f357d 100644 --- a/tests/beman/execution/exec-read-env.test.cpp +++ b/tests/beman/execution/exec-read-env.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-read-env.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-recv-concepts.test.cpp b/tests/beman/execution/exec-recv-concepts.test.cpp index a97ee87f..7c8c3165 100644 --- a/tests/beman/execution/exec-recv-concepts.test.cpp +++ b/tests/beman/execution/exec-recv-concepts.test.cpp @@ -1,11 +1,16 @@ // src/beman/execution/tests/exec-recv-concepts.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include #include -#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-recv.test.cpp b/tests/beman/execution/exec-recv.test.cpp index 69785e1b..02f9bfc9 100644 --- a/tests/beman/execution/exec-recv.test.cpp +++ b/tests/beman/execution/exec-recv.test.cpp @@ -1,8 +1,13 @@ // src/beman/execution/tests/exec-recv.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-run-loop-general.test.cpp b/tests/beman/execution/exec-run-loop-general.test.cpp index d322e1c0..7e26cb5f 100644 --- a/tests/beman/execution/exec-run-loop-general.test.cpp +++ b/tests/beman/execution/exec-run-loop-general.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/exec-run-loop-general.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-run-loop-types.test.cpp b/tests/beman/execution/exec-run-loop-types.test.cpp index 2f0be8e6..6d6e4e87 100644 --- a/tests/beman/execution/exec-run-loop-types.test.cpp +++ b/tests/beman/execution/exec-run-loop-types.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/exec-run-loop-types.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-schedule-from.test.cpp b/tests/beman/execution/exec-schedule-from.test.cpp index d16e338d..2ca51923 100644 --- a/tests/beman/execution/exec-schedule-from.test.cpp +++ b/tests/beman/execution/exec-schedule-from.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-schedule-from.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-schedule.test.cpp b/tests/beman/execution/exec-schedule.test.cpp index b786e074..faabea86 100644 --- a/tests/beman/execution/exec-schedule.test.cpp +++ b/tests/beman/execution/exec-schedule.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/exec-schedule.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-scope-concepts.test.cpp b/tests/beman/execution/exec-scope-concepts.test.cpp index 996d471e..6965b747 100644 --- a/tests/beman/execution/exec-scope-concepts.test.cpp +++ b/tests/beman/execution/exec-scope-concepts.test.cpp @@ -1,9 +1,9 @@ // tests/beman/execution/exec-scope-concepts.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-scope-counting.test.cpp b/tests/beman/execution/exec-scope-counting.test.cpp index e2eb61fd..9959a748 100644 --- a/tests/beman/execution/exec-scope-counting.test.cpp +++ b/tests/beman/execution/exec-scope-counting.test.cpp @@ -1,11 +1,11 @@ // tests/beman/execution/exec-scope-counting.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-scope-simple-counting.test.cpp b/tests/beman/execution/exec-scope-simple-counting.test.cpp index b612d088..139df828 100644 --- a/tests/beman/execution/exec-scope-simple-counting.test.cpp +++ b/tests/beman/execution/exec-scope-simple-counting.test.cpp @@ -1,11 +1,11 @@ // tests/beman/execution/exec-scope-simple-counting.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-set-error.test.cpp b/tests/beman/execution/exec-set-error.test.cpp index 8d446fcb..ec6b6276 100644 --- a/tests/beman/execution/exec-set-error.test.cpp +++ b/tests/beman/execution/exec-set-error.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/exec-set-error.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-set-stopped.test.cpp b/tests/beman/execution/exec-set-stopped.test.cpp index 01e6929c..639bcdb8 100644 --- a/tests/beman/execution/exec-set-stopped.test.cpp +++ b/tests/beman/execution/exec-set-stopped.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/exec-set-stopped.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-set-value.test.cpp b/tests/beman/execution/exec-set-value.test.cpp index d47dfa06..2e3a9e3a 100644 --- a/tests/beman/execution/exec-set-value.test.cpp +++ b/tests/beman/execution/exec-set-value.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-set-value.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-snd-apply.test.cpp b/tests/beman/execution/exec-snd-apply.test.cpp index a4239dfd..581ca62f 100644 --- a/tests/beman/execution/exec-snd-apply.test.cpp +++ b/tests/beman/execution/exec-snd-apply.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-snd-apply.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-snd-concepts.test.cpp b/tests/beman/execution/exec-snd-concepts.test.cpp index f3d5de89..24fe39d5 100644 --- a/tests/beman/execution/exec-snd-concepts.test.cpp +++ b/tests/beman/execution/exec-snd-concepts.test.cpp @@ -1,15 +1,21 @@ // src/beman/execution/tests/exec-snd-concepts.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include -#include -#include #include +#include +#include #include +#include + #include -#include -#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-snd-expos.test.cpp b/tests/beman/execution/exec-snd-expos.test.cpp index ee604b79..c944a13f 100644 --- a/tests/beman/execution/exec-snd-expos.test.cpp +++ b/tests/beman/execution/exec-snd-expos.test.cpp @@ -1,6 +1,12 @@ // src/beman/execution/tests/exec-snd-expos.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include @@ -32,10 +38,9 @@ #include #include #include -#include -#include #include +#endif // ---------------------------------------------------------------------------- @@ -512,7 +517,7 @@ auto test_default_impls_get_attrs() -> void { static_assert(noexcept(test_detail::default_impls::get_attrs(0, child1{}))); static_assert( std::same_as, decltype(test_detail::default_impls::get_attrs(0, child1{}))>); - // static_assert(std::same_as, + //-dk:TODO static_assert(std::same_as, // decltype(test_detail::default_impls::get_attrs(0, child1{}, child2{}))>); } diff --git a/tests/beman/execution/exec-snd-transform.test.cpp b/tests/beman/execution/exec-snd-transform.test.cpp index 168700ea..6526dd9f 100644 --- a/tests/beman/execution/exec-snd-transform.test.cpp +++ b/tests/beman/execution/exec-snd-transform.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/exec-snd-transform.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-spawn-future.test.cpp b/tests/beman/execution/exec-spawn-future.test.cpp index 371e90e1..8d0baff7 100644 --- a/tests/beman/execution/exec-spawn-future.test.cpp +++ b/tests/beman/execution/exec-spawn-future.test.cpp @@ -1,6 +1,13 @@ // tests/beman/execution/exec-spawn-future.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include @@ -16,8 +23,7 @@ #include #include #include -#include -#include +#endif // ---------------------------------------------------------------------------- @@ -424,6 +430,7 @@ auto test_spawn_future() { ASSERT(handle != nullptr); ASSERT(result == 0); #if 0 + //-dk:TODO using type = typename test_detail::completion_signatures_for_impl>::type; static_assert(std::same_as, type>); static_assert(std::same_as< diff --git a/tests/beman/execution/exec-spawn.test.cpp b/tests/beman/execution/exec-spawn.test.cpp index e5d0cf7e..8120b486 100644 --- a/tests/beman/execution/exec-spawn.test.cpp +++ b/tests/beman/execution/exec-spawn.test.cpp @@ -1,17 +1,22 @@ // tests/beman/execution/exec-spawn.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include #include #include #include -#include -#include -#include -#include -#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-split.test.cpp b/tests/beman/execution/exec-split.test.cpp index 53d5c2ab..cc6135a6 100644 --- a/tests/beman/execution/exec-split.test.cpp +++ b/tests/beman/execution/exec-split.test.cpp @@ -1,13 +1,22 @@ // src/beman/execution/tests/split.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include -#include #include #include #include #include +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else +#include +#include +#include +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-starts-on.test.cpp b/tests/beman/execution/exec-starts-on.test.cpp index af325ecb..f2781f64 100644 --- a/tests/beman/execution/exec-starts-on.test.cpp +++ b/tests/beman/execution/exec-starts-on.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-starts-on.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-stop-when.test.cpp b/tests/beman/execution/exec-stop-when.test.cpp index 52690c05..f0732a75 100644 --- a/tests/beman/execution/exec-stop-when.test.cpp +++ b/tests/beman/execution/exec-stop-when.test.cpp @@ -1,6 +1,15 @@ // tests/beman/execution/exec-stop-when.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include @@ -17,11 +26,7 @@ #include #include #include -#include -#include -#include -#include -#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-sync-wait.test.cpp b/tests/beman/execution/exec-sync-wait.test.cpp index 489bb0a7..7458c7ff 100644 --- a/tests/beman/execution/exec-sync-wait.test.cpp +++ b/tests/beman/execution/exec-sync-wait.test.cpp @@ -1,13 +1,14 @@ // src/beman/execution/tests/exec-sync-wait.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; +import beman.execution.detail; #else #include #endif diff --git a/tests/beman/execution/exec-then.test.cpp b/tests/beman/execution/exec-then.test.cpp index 4a285478..e743f6cb 100644 --- a/tests/beman/execution/exec-then.test.cpp +++ b/tests/beman/execution/exec-then.test.cpp @@ -1,12 +1,12 @@ // src/beman/execution/tests/exec-then.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include #include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/exec-utils-cmplsigs.test.cpp b/tests/beman/execution/exec-utils-cmplsigs.test.cpp index ab77490f..a2371afe 100644 --- a/tests/beman/execution/exec-utils-cmplsigs.test.cpp +++ b/tests/beman/execution/exec-utils-cmplsigs.test.cpp @@ -1,6 +1,14 @@ // src/beman/execution/tests/exec-utils-cmplsigs.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include @@ -8,9 +16,7 @@ #include #include #include -#include -#include -#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/exec-when-all.test.cpp b/tests/beman/execution/exec-when-all.test.cpp index 900aec66..1684014b 100644 --- a/tests/beman/execution/exec-when-all.test.cpp +++ b/tests/beman/execution/exec-when-all.test.cpp @@ -1,12 +1,12 @@ // src/beman/execution/tests/exec-when-all.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include #include #include #include +#include // #include #ifdef BEMAN_HAS_MODULES import beman.execution; diff --git a/tests/beman/execution/exec-with-awaitable-senders.test.cpp b/tests/beman/execution/exec-with-awaitable-senders.test.cpp index 083e0d7a..b47c8cf4 100644 --- a/tests/beman/execution/exec-with-awaitable-senders.test.cpp +++ b/tests/beman/execution/exec-with-awaitable-senders.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/exec-with-awaitable-senders.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/execution-queryable-concept.test.cpp b/tests/beman/execution/execution-queryable-concept.test.cpp index e5a6cf8b..8737e915 100644 --- a/tests/beman/execution/execution-queryable-concept.test.cpp +++ b/tests/beman/execution/execution-queryable-concept.test.cpp @@ -1,8 +1,13 @@ // src/beman/execution/tests/queryable.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/execution-syn.test.cpp b/tests/beman/execution/execution-syn.test.cpp index 32ef7faf..4755ccac 100644 --- a/tests/beman/execution/execution-syn.test.cpp +++ b/tests/beman/execution/execution-syn.test.cpp @@ -1,6 +1,13 @@ // src/beman/execution/tests/execution-syn.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include #include @@ -16,10 +23,9 @@ #include #include #include -#include -#include #include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/forward-like.test.cpp b/tests/beman/execution/forward-like.test.cpp index fdb7eaf5..00287757 100644 --- a/tests/beman/execution/forward-like.test.cpp +++ b/tests/beman/execution/forward-like.test.cpp @@ -1,9 +1,14 @@ // src/beman/execution/tests/forward-like.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/functional-syn.test.cpp b/tests/beman/execution/functional-syn.test.cpp index 6b6d8739..f76ad7bd 100644 --- a/tests/beman/execution/functional-syn.test.cpp +++ b/tests/beman/execution/functional-syn.test.cpp @@ -1,9 +1,14 @@ // src/beman/execution/tests/functional-syn.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include #include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/include/test/thread_pool.hpp b/tests/beman/execution/include/test/thread_pool.hpp index 92bac997..d648c127 100644 --- a/tests/beman/execution/include/test/thread_pool.hpp +++ b/tests/beman/execution/include/test/thread_pool.hpp @@ -5,13 +5,18 @@ #ifndef INCLUDED_TESTS_BEMAN_EXECUTION_INCLUDE_TEST_THREAD_POOL #define INCLUDED_TESTS_BEMAN_EXECUTION_INCLUDE_TEST_THREAD_POOL -#include -#include - -#include #include -#include #include +#include +#include +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +#else +#include +#endif + // ---------------------------------------------------------------------------- namespace test { diff --git a/tests/beman/execution/issue-174.test.cpp b/tests/beman/execution/issue-174.test.cpp index aa462d0d..0b777fc0 100644 --- a/tests/beman/execution/issue-174.test.cpp +++ b/tests/beman/execution/issue-174.test.cpp @@ -1,9 +1,9 @@ // tests/beman/execution/issue-174.test.cpp *-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/meta-combine.test.cpp b/tests/beman/execution/meta-combine.test.cpp index f8e32bd8..5e594106 100644 --- a/tests/beman/execution/meta-combine.test.cpp +++ b/tests/beman/execution/meta-combine.test.cpp @@ -1,9 +1,13 @@ // src/beman/execution/tests/meta-combine.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include #include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/meta-contains.test.cpp b/tests/beman/execution/meta-contains.test.cpp index 115eddbc..17286908 100644 --- a/tests/beman/execution/meta-contains.test.cpp +++ b/tests/beman/execution/meta-contains.test.cpp @@ -1,8 +1,12 @@ // src/beman/execution/tests/meta-contains.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/meta-filter.test.cpp b/tests/beman/execution/meta-filter.test.cpp index 5ec73914..5aef5582 100644 --- a/tests/beman/execution/meta-filter.test.cpp +++ b/tests/beman/execution/meta-filter.test.cpp @@ -1,9 +1,13 @@ // src/beman/execution/tests/meta-filter.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include #include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/meta-prepend.test.cpp b/tests/beman/execution/meta-prepend.test.cpp index 4b4a0db8..4923ccc1 100644 --- a/tests/beman/execution/meta-prepend.test.cpp +++ b/tests/beman/execution/meta-prepend.test.cpp @@ -1,9 +1,13 @@ // src/beman/execution/tests/meta-prepend.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include #include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/meta-transform.test.cpp b/tests/beman/execution/meta-transform.test.cpp index 529c6411..3f69e132 100644 --- a/tests/beman/execution/meta-transform.test.cpp +++ b/tests/beman/execution/meta-transform.test.cpp @@ -1,11 +1,15 @@ // src/beman/execution/tests/meta-transform.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include -#include #include #include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail; +#else +#include +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/meta-unique.test.cpp b/tests/beman/execution/meta-unique.test.cpp index 2d336a3d..7a6c7a98 100644 --- a/tests/beman/execution/meta-unique.test.cpp +++ b/tests/beman/execution/meta-unique.test.cpp @@ -1,9 +1,13 @@ // src/beman/execution/tests/meta-unique.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include #include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/non_assignable.test.cpp b/tests/beman/execution/non_assignable.test.cpp index 962dcbb9..08f299e2 100644 --- a/tests/beman/execution/non_assignable.test.cpp +++ b/tests/beman/execution/non_assignable.test.cpp @@ -1,9 +1,13 @@ // tests/beman/execution/non_assignable.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail; +#else +#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/notify.test.cpp b/tests/beman/execution/notify.test.cpp index 0b15efb7..a64bc5fb 100644 --- a/tests/beman/execution/notify.test.cpp +++ b/tests/beman/execution/notify.test.cpp @@ -1,10 +1,15 @@ // src/beman/execution/tests/notify.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include #include -#include -#include +#endif // ---------------------------------------------------------------------------- diff --git a/tests/beman/execution/stopcallback-cons.test.cpp b/tests/beman/execution/stopcallback-cons.test.cpp index 4212f735..56e1c5ab 100644 --- a/tests/beman/execution/stopcallback-cons.test.cpp +++ b/tests/beman/execution/stopcallback-cons.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/stopcallback-cons.test.cpp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/stopcallback-general.test.cpp b/tests/beman/execution/stopcallback-general.test.cpp index 7bd73d7c..d26d336e 100644 --- a/tests/beman/execution/stopcallback-general.test.cpp +++ b/tests/beman/execution/stopcallback-general.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/stopcallback-general.test.cpp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/stopcallback-inplace-cons.test.cpp b/tests/beman/execution/stopcallback-inplace-cons.test.cpp index d0010e45..85903402 100644 --- a/tests/beman/execution/stopcallback-inplace-cons.test.cpp +++ b/tests/beman/execution/stopcallback-inplace-cons.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/stopcallback-inplace-cons.test.cpp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/stopcallback-inplace-general.test.cpp b/tests/beman/execution/stopcallback-inplace-general.test.cpp index 49816ff9..a6899781 100644 --- a/tests/beman/execution/stopcallback-inplace-general.test.cpp +++ b/tests/beman/execution/stopcallback-inplace-general.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/stopcallback-inplace-general.test.cpp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/stopsource-cons.test.cpp b/tests/beman/execution/stopsource-cons.test.cpp index 0b364bb7..b8d58916 100644 --- a/tests/beman/execution/stopsource-cons.test.cpp +++ b/tests/beman/execution/stopsource-cons.test.cpp @@ -1,12 +1,12 @@ // src/beman/execution/tests/stopsource-cons.test.cpp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include #include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/stopsource-inplace-cons.test.cpp b/tests/beman/execution/stopsource-inplace-cons.test.cpp index 786bab4e..db2231c9 100644 --- a/tests/beman/execution/stopsource-inplace-cons.test.cpp +++ b/tests/beman/execution/stopsource-inplace-cons.test.cpp @@ -1,8 +1,8 @@ // src/beman/execution/tests/stopsource-inplace-cons.test.cpp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/stopsource-inplace-general.test.cpp b/tests/beman/execution/stopsource-inplace-general.test.cpp index 54d41e5e..e54b9688 100644 --- a/tests/beman/execution/stopsource-inplace-general.test.cpp +++ b/tests/beman/execution/stopsource-inplace-general.test.cpp @@ -4,6 +4,7 @@ #include #ifdef BEMAN_HAS_MODULES import beman.execution; +import beman.execution.detail; #else #include #endif diff --git a/tests/beman/execution/stopsource.test.cpp b/tests/beman/execution/stopsource.test.cpp index 74882c42..5084d8b2 100644 --- a/tests/beman/execution/stopsource.test.cpp +++ b/tests/beman/execution/stopsource.test.cpp @@ -9,5 +9,5 @@ import beman.execution; #endif TEST(stopsource) { - // section [thread] is empty + // section [stopsource] is empty } diff --git a/tests/beman/execution/stoptoken-concepts.test.cpp b/tests/beman/execution/stoptoken-concepts.test.cpp index 748d1552..b2105720 100644 --- a/tests/beman/execution/stoptoken-concepts.test.cpp +++ b/tests/beman/execution/stoptoken-concepts.test.cpp @@ -3,7 +3,12 @@ #include #include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include +#endif namespace { namespace detail_stopppable_callback_for { diff --git a/tests/beman/execution/stoptoken-inplace-general.test.cpp b/tests/beman/execution/stoptoken-inplace-general.test.cpp index 241455bb..e9b0a01f 100644 --- a/tests/beman/execution/stoptoken-inplace-general.test.cpp +++ b/tests/beman/execution/stoptoken-inplace-general.test.cpp @@ -1,9 +1,9 @@ // src/beman/execution/tests/stoptoken-inplace-general.test.cpp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include +#include #ifdef BEMAN_HAS_MODULES import beman.execution; #else diff --git a/tests/beman/execution/thread-stoptoken-intro.test.cpp b/tests/beman/execution/thread-stoptoken-intro.test.cpp index 471a0619..9e2e7c7f 100644 --- a/tests/beman/execution/thread-stoptoken-intro.test.cpp +++ b/tests/beman/execution/thread-stoptoken-intro.test.cpp @@ -1,17 +1,21 @@ // src/beman/execution/tests/thread-stoptoken-intro.test.cpp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include #include #include #ifdef BEMAN_HAS_MODULES import beman.execution; #else +#include #include #endif namespace { -struct test_source : test_detail::immovable { +struct immovable { + immovable() = default; + immovable(immovable&&) = delete; +}; +struct test_source : immovable { struct callback_base { callback_base() = default; callback_base(callback_base&&) = default; diff --git a/tests/beman/execution/thread-stoptoken-syn.compile.test.cpp b/tests/beman/execution/thread-stoptoken-syn.compile.test.cpp index 0e2b36ad..f0cc330d 100644 --- a/tests/beman/execution/thread-stoptoken-syn.compile.test.cpp +++ b/tests/beman/execution/thread-stoptoken-syn.compile.test.cpp @@ -2,7 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#ifdef BEMAN_HAS_MODULES +import beman.execution; +import beman.execution.detail; +#else #include +#endif namespace { template From c98e731ea5b2f39480b9564b1bb0eab85c451c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 7 Feb 2026 00:37:49 +0000 Subject: [PATCH 02/18] fixed the module use for the examples --- examples/CMakeLists.txt | 1 + examples/intro-5-consumer.cpp | 1 + examples/just_stopped.cpp | 4 ++++ examples/modules.cpp | 4 ---- examples/sender-demo.cpp | 1 + src/beman/execution/execution-detail.cppm | 5 +++++ src/beman/execution/execution.cppm | 2 ++ 7 files changed, 14 insertions(+), 4 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index c7388882..cf4c5ea7 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -43,6 +43,7 @@ foreach(EXAMPLE ${EXAMPLES}) add_executable(${EXAMPLE_TARGET}) target_sources(${EXAMPLE_TARGET} PRIVATE ${EXAMPLE}.cpp) if(BEMAN_USE_MODULES) + target_compile_definitions(${EXAMPLE_TARGET} PUBLIC BEMAN_HAS_MODULES) target_link_libraries(${EXAMPLE_TARGET} PRIVATE beman::execution) else() target_link_libraries( diff --git a/examples/intro-5-consumer.cpp b/examples/intro-5-consumer.cpp index 126e3a27..0d300a53 100644 --- a/examples/intro-5-consumer.cpp +++ b/examples/intro-5-consumer.cpp @@ -11,6 +11,7 @@ #include #ifdef BEMAN_HAS_MODULES import beman.execution; +import beman.execution.detail; #else #include #endif diff --git a/examples/just_stopped.cpp b/examples/just_stopped.cpp index fe0baee0..fe9d5593 100644 --- a/examples/just_stopped.cpp +++ b/examples/just_stopped.cpp @@ -1,7 +1,11 @@ // examples/just_stopped.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#ifdef BEMAN_HAS_MODULES +import beman.execution; +#else #include +#endif namespace ex = beman::execution; struct receiver { diff --git a/examples/modules.cpp b/examples/modules.cpp index ea400d62..d1ffb843 100644 --- a/examples/modules.cpp +++ b/examples/modules.cpp @@ -14,11 +14,7 @@ import std; #endif -#ifdef BEMAN_HAS_MODULES import beman.execution; -#else -#include -#endif namespace ex = beman::execution; diff --git a/examples/sender-demo.cpp b/examples/sender-demo.cpp index 6f4c1aa3..aa31f9f1 100644 --- a/examples/sender-demo.cpp +++ b/examples/sender-demo.cpp @@ -9,6 +9,7 @@ #include #ifdef BEMAN_HAS_MODULES import beman.execution; +import beman.execution.detail; #else #include #endif diff --git a/src/beman/execution/execution-detail.cppm b/src/beman/execution/execution-detail.cppm index 9fe407eb..326fe38e 100644 --- a/src/beman/execution/execution-detail.cppm +++ b/src/beman/execution/execution-detail.cppm @@ -4,6 +4,7 @@ module; #include #include +#include #include #include #include @@ -22,6 +23,7 @@ module; #include #include #include +#include #include #include #include @@ -96,6 +98,7 @@ export using beman::execution::detail::meta::unique; namespace beman::execution::detail { export using beman::execution::detail::always_true; export using beman::execution::detail::as_except_ptr; +export using beman::execution::detail::await_result_type; export using beman::execution::detail::await_suspend_result; export using beman::execution::detail::basic_operation; export using beman::execution::detail::basic_receiver; @@ -119,6 +122,7 @@ export using beman::execution::detail::decays_to; export using beman::execution::detail::default_impls; export using beman::execution::detail::empty_variant; export using beman::execution::detail::enable_sender; +export using beman::execution::detail::env_promise; export using beman::execution::detail::env_type; export using beman::execution::detail::forward_like; export using beman::execution::detail::fwd_env; @@ -136,6 +140,7 @@ export using beman::execution::detail::indirect_meta_apply; export using beman::execution::detail::is_awaitable; export using beman::execution::detail::is_awaiter; export using beman::execution::detail::is_product_type; +export using beman::execution::detail::is_product_type_c; export using beman::execution::detail::is_sender; export using beman::execution::detail::is_sender_adaptor_closure; export using beman::execution::detail::join_env; diff --git a/src/beman/execution/execution.cppm b/src/beman/execution/execution.cppm index 5031b71b..03ca5871 100644 --- a/src/beman/execution/execution.cppm +++ b/src/beman/execution/execution.cppm @@ -239,6 +239,7 @@ export using ::beman::execution::associate; export using ::beman::execution::spawn; export using ::beman::execution::spawn_future; +#if 0 namespace detail { export using ::beman::execution::detail::await_result_type; export using ::beman::execution::detail::basic_sender; @@ -253,6 +254,7 @@ export using ::beman::execution::detail::sync_wait_receiver; export using ::beman::execution::detail::sync_wait_result_type; export using ::beman::execution::detail::sync_wait_state; } // namespace detail +#endif } // namespace beman::execution From 7536b4379d17cb667abcf67200215c5b4185b80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 7 Feb 2026 15:55:53 +0000 Subject: [PATCH 03/18] restructured everything [optionally] use modules per component --- bin/mk-module.py | 1 + include/beman/execution/detail/affine_on.hpp | 29 +-- .../execution/detail/allocator_aware_move.hpp | 36 ++-- .../execution/detail/almost_scheduler.hpp | 29 +-- .../beman/execution/detail/apply_sender.hpp | 23 ++- .../beman/execution/detail/as_awaitable.hpp | 42 +++-- .../beman/execution/detail/as_except_ptr.hpp | 4 + include/beman/execution/detail/as_tuple.hpp | 13 +- include/beman/execution/detail/associate.hpp | 30 +++- .../detail/atomic_intrusive_stack.hpp | 16 +- .../execution/detail/await_result_type.hpp | 21 ++- .../execution/detail/await_suspend_result.hpp | 4 + .../execution/detail/awaitable_sender.hpp | 21 ++- .../execution/detail/basic_operation.hpp | 94 +++++----- .../beman/execution/detail/basic_receiver.hpp | 72 ++++---- .../beman/execution/detail/basic_sender.hpp | 44 +++-- .../beman/execution/detail/basic_state.hpp | 34 ++-- include/beman/execution/detail/bulk.hpp | 48 ++--- .../beman/execution/detail/call_result_t.hpp | 4 + include/beman/execution/detail/callable.hpp | 4 + .../detail/check_type_alias_exist.hpp | 4 + include/beman/execution/detail/child_type.hpp | 4 + include/beman/execution/detail/class_type.hpp | 19 +- .../execution/detail/completion_domain.hpp | 17 +- .../execution/detail/completion_signature.hpp | 16 +- .../detail/completion_signatures.hpp | 19 +- .../detail/completion_signatures_for.hpp | 22 ++- .../detail/completion_signatures_of_t.hpp | 20 ++- .../beman/execution/detail/completion_tag.hpp | 21 ++- include/beman/execution/detail/connect.hpp | 40 ++--- .../beman/execution/detail/connect_all.hpp | 39 ++-- .../execution/detail/connect_all_result.hpp | 24 +-- .../execution/detail/connect_awaitable.hpp | 27 +-- .../execution/detail/connect_result_t.hpp | 19 +- .../beman/execution/detail/continues_on.hpp | 48 ++--- .../beman/execution/detail/counting_scope.hpp | 19 +- .../execution/detail/counting_scope_base.hpp | 15 +- .../execution/detail/counting_scope_join.hpp | 24 +-- .../execution/detail/decayed_same_as.hpp | 4 + .../beman/execution/detail/decayed_tuple.hpp | 4 + .../execution/detail/decayed_type_list.hpp | 16 +- .../beman/execution/detail/decayed_typeof.hpp | 4 + include/beman/execution/detail/decays_to.hpp | 4 + .../beman/execution/detail/default_domain.hpp | 27 +-- .../beman/execution/detail/default_impls.hpp | 28 +-- .../beman/execution/detail/emplace_from.hpp | 30 ++-- include/beman/execution/detail/env.hpp | 17 +- include/beman/execution/detail/env_of_t.hpp | 19 +- .../beman/execution/detail/env_promise.hpp | 33 ++-- include/beman/execution/detail/env_type.hpp | 24 +-- .../execution/detail/error_types_of_t.hpp | 30 ++-- .../beman/execution/detail/forward_like.hpp | 4 + .../execution/detail/forwarding_query.hpp | 4 + include/beman/execution/detail/fwd_env.hpp | 55 +++--- .../execution/detail/gather_signatures.hpp | 18 +- .../beman/execution/detail/get_allocator.hpp | 24 ++- .../beman/execution/detail/get_awaiter.hpp | 4 + .../detail/get_completion_scheduler.hpp | 25 +-- .../detail/get_completion_signatures.hpp | 31 ++-- .../detail/get_delegation_scheduler.hpp | 21 ++- include/beman/execution/detail/get_domain.hpp | 24 +-- .../execution/detail/get_domain_early.hpp | 16 +- .../execution/detail/get_domain_late.hpp | 20 ++- include/beman/execution/detail/get_env.hpp | 23 ++- .../beman/execution/detail/get_scheduler.hpp | 19 +- .../beman/execution/detail/get_stop_token.hpp | 18 +- .../execution/detail/has_as_awaitable.hpp | 17 +- .../execution/detail/has_completions.hpp | 18 +- include/beman/execution/detail/immovable.hpp | 4 + include/beman/execution/detail/impls_for.hpp | 14 +- .../beman/execution/detail/indices_for.hpp | 4 + .../execution/detail/indirect_meta_apply.hpp | 4 + .../execution/detail/inplace_stop_source.hpp | 15 +- .../beman/execution/detail/into_variant.hpp | 41 +++-- .../execution/detail/intrusive_stack.hpp | 4 + .../beman/execution/detail/is_awaitable.hpp | 19 +- include/beman/execution/detail/is_awaiter.hpp | 21 ++- include/beman/execution/detail/join_env.hpp | 4 + include/beman/execution/detail/just.hpp | 31 ++-- include/beman/execution/detail/let.hpp | 69 ++++---- include/beman/execution/detail/make_env.hpp | 4 + .../beman/execution/detail/make_sender.hpp | 19 +- .../beman/execution/detail/matching_sig.hpp | 4 + .../beman/execution/detail/meta_combine.hpp | 16 +- .../execution/detail/meta_contain_same.hpp | 14 +- .../beman/execution/detail/meta_contains.hpp | 4 + .../beman/execution/detail/meta_filter.hpp | 16 +- .../beman/execution/detail/meta_prepend.hpp | 4 + include/beman/execution/detail/meta_size.hpp | 4 + include/beman/execution/detail/meta_to.hpp | 4 + .../beman/execution/detail/meta_transform.hpp | 14 +- .../beman/execution/detail/meta_unique.hpp | 18 +- .../beman/execution/detail/movable_value.hpp | 4 + .../detail/nested_sender_has_affine_on.hpp | 15 +- .../execution/detail/never_stop_token.hpp | 4 + .../beman/execution/detail/non_assignable.hpp | 4 + .../beman/execution/detail/nostopstate.hpp | 4 + .../execution/detail/nothrow_callable.hpp | 15 +- include/beman/execution/detail/notify.hpp | 17 +- include/beman/execution/detail/on.hpp | 58 +++--- .../execution/detail/on_stop_request.hpp | 4 + .../execution/detail/operation_state.hpp | 15 +- .../execution/detail/operation_state_task.hpp | 24 ++- .../beman/execution/detail/product_type.hpp | 12 +- include/beman/execution/detail/prop.hpp | 16 +- .../execution/detail/query_with_default.hpp | 4 + include/beman/execution/detail/queryable.hpp | 4 + include/beman/execution/detail/read_env.hpp | 21 ++- include/beman/execution/detail/receiver.hpp | 17 +- .../beman/execution/detail/receiver_of.hpp | 15 +- include/beman/execution/detail/run_loop.hpp | 38 ++-- .../beman/execution/detail/sched_attrs.hpp | 45 ++--- include/beman/execution/detail/sched_env.hpp | 46 ++--- include/beman/execution/detail/schedule.hpp | 24 +-- .../beman/execution/detail/schedule_from.hpp | 40 +++-- .../execution/detail/schedule_result_t.hpp | 18 +- include/beman/execution/detail/scheduler.hpp | 22 +-- .../beman/execution/detail/scheduler_t.hpp | 4 + .../beman/execution/detail/scope_token.hpp | 21 ++- include/beman/execution/detail/sender.hpp | 21 ++- .../beman/execution/detail/sender_adaptor.hpp | 34 ++-- .../detail/sender_adaptor_closure.hpp | 15 +- .../execution/detail/sender_awaitable.hpp | 105 +++++------ .../execution/detail/sender_decompose.hpp | 4 + include/beman/execution/detail/sender_for.hpp | 16 +- .../execution/detail/sender_has_affine_on.hpp | 24 +-- include/beman/execution/detail/sender_in.hpp | 21 +-- .../beman/execution/detail/sends_stopped.hpp | 26 +-- include/beman/execution/detail/set_error.hpp | 7 +- .../beman/execution/detail/set_stopped.hpp | 7 +- include/beman/execution/detail/set_value.hpp | 7 +- .../execution/detail/simple_allocator.hpp | 6 +- .../detail/simple_counting_scope.hpp | 17 +- .../beman/execution/detail/single_sender.hpp | 17 +- .../detail/single_sender_value_type.hpp | 18 +- include/beman/execution/detail/spawn.hpp | 33 ++-- .../beman/execution/detail/spawn_future.hpp | 23 ++- .../execution/detail/spawn_get_allocator.hpp | 36 ++-- include/beman/execution/detail/split.hpp | 37 ++-- include/beman/execution/detail/start.hpp | 5 +- include/beman/execution/detail/starts_on.hpp | 44 ++--- include/beman/execution/detail/state_type.hpp | 22 ++- .../execution/detail/stop_callback_for_t.hpp | 4 + .../beman/execution/detail/stop_source.hpp | 15 +- .../execution/detail/stop_token_of_t.hpp | 16 +- include/beman/execution/detail/stop_when.hpp | 45 ++--- .../execution/detail/stoppable_source.hpp | 10 +- .../execution/detail/stoppable_token.hpp | 23 ++- .../execution/detail/suspend_complete.hpp | 6 +- include/beman/execution/detail/sync_wait.hpp | 41 +++-- include/beman/execution/detail/tag_of_t.hpp | 16 +- include/beman/execution/detail/then.hpp | 32 ++-- .../execution/detail/transform_sender.hpp | 22 ++- include/beman/execution/detail/type_list.hpp | 4 + .../execution/detail/unspecified_promise.hpp | 4 + .../execution/detail/unstoppable_token.hpp | 19 +- .../execution/detail/valid_completion_for.hpp | 18 +- .../detail/valid_completion_signatures.hpp | 16 +- .../execution/detail/valid_specialization.hpp | 4 + .../execution/detail/value_types_of_t.hpp | 26 +-- .../execution/detail/variant_or_empty.hpp | 16 +- include/beman/execution/detail/when_all.hpp | 45 +++-- .../detail/when_all_with_variant.hpp | 38 ++-- .../execution/detail/with_await_transform.hpp | 26 +-- .../detail/with_awaitable_senders.hpp | 39 ++-- include/beman/execution/detail/write_env.hpp | 25 +-- include/beman/execution/execution.hpp | 27 +-- include/beman/execution/functional.hpp | 8 +- include/beman/execution/stop_token.hpp | 4 + src/beman/execution/CMakeLists.txt | 165 +++++++++++++++++ src/beman/execution/affine_on.cppm | 12 ++ src/beman/execution/allocator_aware_move.cppm | 11 ++ src/beman/execution/almost_scheduler.cppm | 11 ++ src/beman/execution/apply_sender.cppm | 11 ++ src/beman/execution/as_awaitable.cppm | 11 ++ src/beman/execution/as_except_ptr.cppm | 11 ++ src/beman/execution/as_tuple.cppm | 11 ++ src/beman/execution/associate.cppm | 12 ++ .../execution/atomic_intrusive_stack.cppm | 11 ++ src/beman/execution/await_result_type.cppm | 11 ++ src/beman/execution/await_suspend_result.cppm | 11 ++ src/beman/execution/awaitable_sender.cppm | 11 ++ src/beman/execution/basic_operation.cppm | 11 ++ src/beman/execution/basic_receiver.cppm | 11 ++ src/beman/execution/basic_sender.cppm | 11 ++ src/beman/execution/basic_state.cppm | 11 ++ src/beman/execution/bulk.cppm | 12 ++ src/beman/execution/call_result_t.cppm | 11 ++ src/beman/execution/callable.cppm | 11 ++ .../execution/check_type_alias_exist.cppm | 11 ++ src/beman/execution/child_type.cppm | 11 ++ src/beman/execution/class_type.cppm | 11 ++ src/beman/execution/completion_domain.cppm | 11 ++ src/beman/execution/completion_signature.cppm | 11 ++ .../execution/completion_signatures.cppm | 11 ++ .../execution/completion_signatures_for.cppm | 13 ++ .../execution/completion_signatures_of_t.cppm | 11 ++ src/beman/execution/completion_tag.cppm | 11 ++ src/beman/execution/connect.cppm | 12 ++ src/beman/execution/connect_all.cppm | 11 ++ src/beman/execution/connect_all_result.cppm | 11 ++ src/beman/execution/connect_awaitable.cppm | 11 ++ src/beman/execution/connect_result_t.cppm | 11 ++ src/beman/execution/continues_on.cppm | 12 ++ src/beman/execution/counting_scope.cppm | 11 ++ src/beman/execution/counting_scope_base.cppm | 11 ++ src/beman/execution/counting_scope_join.cppm | 11 ++ src/beman/execution/decayed_same_as.cppm | 11 ++ src/beman/execution/decayed_tuple.cppm | 11 ++ src/beman/execution/decayed_type_list.cppm | 11 ++ src/beman/execution/decayed_typeof.cppm | 11 ++ src/beman/execution/decays_to.cppm | 11 ++ src/beman/execution/default_domain.cppm | 11 ++ src/beman/execution/default_impls.cppm | 11 ++ src/beman/execution/emplace_from.cppm | 11 ++ src/beman/execution/env.cppm | 11 ++ src/beman/execution/env_of_t.cppm | 11 ++ src/beman/execution/env_promise.cppm | 11 ++ src/beman/execution/env_type.cppm | 11 ++ src/beman/execution/error_types_of_t.cppm | 11 ++ src/beman/execution/execution-detail.cppm | 166 +++++++++--------- src/beman/execution/forward_like.cppm | 12 ++ src/beman/execution/forwarding_query.cppm | 11 ++ src/beman/execution/fwd_env.cppm | 11 ++ src/beman/execution/gather_signatures.cppm | 12 ++ src/beman/execution/get_allocator.cppm | 12 ++ src/beman/execution/get_awaiter.cppm | 11 ++ .../execution/get_completion_scheduler.cppm | 12 ++ .../execution/get_completion_signatures.cppm | 12 ++ .../execution/get_delegation_scheduler.cppm | 12 ++ src/beman/execution/get_domain.cppm | 12 ++ src/beman/execution/get_domain_early.cppm | 11 ++ src/beman/execution/get_domain_late.cppm | 11 ++ src/beman/execution/get_env.cppm | 12 ++ src/beman/execution/get_scheduler.cppm | 12 ++ src/beman/execution/get_stop_token.cppm | 12 ++ src/beman/execution/has_as_awaitable.cppm | 11 ++ src/beman/execution/has_completions.cppm | 11 ++ src/beman/execution/immovable.cppm | 11 ++ src/beman/execution/impls_for.cppm | 11 ++ src/beman/execution/indices_for.cppm | 11 ++ src/beman/execution/indirect_meta_apply.cppm | 11 ++ src/beman/execution/inplace_stop_source.cppm | 11 ++ src/beman/execution/into_variant.cppm | 11 ++ src/beman/execution/intrusive_stack.cppm | 11 ++ src/beman/execution/is_awaitable.cppm | 11 ++ src/beman/execution/is_awaiter.cppm | 11 ++ src/beman/execution/join_env.cppm | 11 ++ src/beman/execution/just.cppm | 16 ++ src/beman/execution/let.cppm | 16 ++ src/beman/execution/make_env.cppm | 11 ++ src/beman/execution/make_sender.cppm | 11 ++ src/beman/execution/matching_sig.cppm | 11 ++ src/beman/execution/meta_combine.cppm | 11 ++ src/beman/execution/meta_contain_same.cppm | 11 ++ src/beman/execution/meta_contains.cppm | 11 ++ src/beman/execution/meta_filter.cppm | 11 ++ src/beman/execution/meta_prepend.cppm | 11 ++ src/beman/execution/meta_size.cppm | 11 ++ src/beman/execution/meta_to.cppm | 11 ++ src/beman/execution/meta_transform.cppm | 11 ++ src/beman/execution/meta_unique.cppm | 11 ++ src/beman/execution/movable_value.cppm | 11 ++ .../nested_sender_has_affine_on.cppm | 11 ++ src/beman/execution/never_stop_token.cppm | 11 ++ src/beman/execution/non_assignable.cppm | 11 ++ src/beman/execution/nostopstate.cppm | 11 ++ src/beman/execution/nothrow_callable.cppm | 11 ++ src/beman/execution/notify.cppm | 13 ++ src/beman/execution/on.cppm | 12 ++ src/beman/execution/on_stop_request.cppm | 11 ++ src/beman/execution/operation_state.cppm | 12 ++ src/beman/execution/operation_state_task.cppm | 12 ++ src/beman/execution/product_type.cppm | 13 ++ src/beman/execution/prop.cppm | 11 ++ src/beman/execution/query_with_default.cppm | 11 ++ src/beman/execution/queryable.cppm | 11 ++ src/beman/execution/read_env.cppm | 12 ++ src/beman/execution/receiver.cppm | 12 ++ src/beman/execution/receiver_of.cppm | 11 ++ src/beman/execution/run_loop.cppm | 11 ++ src/beman/execution/sched_attrs.cppm | 11 ++ src/beman/execution/sched_env.cppm | 11 ++ src/beman/execution/schedule.cppm | 12 ++ src/beman/execution/schedule_from.cppm | 12 ++ src/beman/execution/schedule_result_t.cppm | 11 ++ src/beman/execution/scheduler.cppm | 11 ++ src/beman/execution/scheduler_t.cppm | 11 ++ src/beman/execution/scope_token.cppm | 11 ++ src/beman/execution/sender.cppm | 16 ++ src/beman/execution/sender_adaptor.cppm | 11 ++ .../execution/sender_adaptor_closure.cppm | 14 ++ src/beman/execution/sender_awaitable.cppm | 11 ++ src/beman/execution/sender_decompose.cppm | 11 ++ src/beman/execution/sender_for.cppm | 11 ++ src/beman/execution/sender_has_affine_on.cppm | 11 ++ src/beman/execution/sender_in.cppm | 11 ++ src/beman/execution/sends_stopped.cppm | 11 ++ src/beman/execution/set_error.cppm | 12 ++ src/beman/execution/set_stopped.cppm | 12 ++ src/beman/execution/set_value.cppm | 12 ++ src/beman/execution/simple_allocator.cppm | 11 ++ .../execution/simple_counting_scope.cppm | 11 ++ src/beman/execution/single_sender.cppm | 11 ++ .../execution/single_sender_value_type.cppm | 11 ++ src/beman/execution/spawn.cppm | 15 ++ src/beman/execution/spawn_future.cppm | 16 ++ src/beman/execution/spawn_get_allocator.cppm | 11 ++ src/beman/execution/split.cppm | 12 ++ src/beman/execution/start.cppm | 12 ++ src/beman/execution/starts_on.cppm | 12 ++ src/beman/execution/state_type.cppm | 11 ++ src/beman/execution/stop_callback_for_t.cppm | 14 ++ src/beman/execution/stop_source.cppm | 11 ++ src/beman/execution/stop_token_of_t.cppm | 11 ++ src/beman/execution/stop_when.cppm | 12 ++ src/beman/execution/stoppable_source.cppm | 11 ++ src/beman/execution/stoppable_token.cppm | 11 ++ src/beman/execution/suspend_complete.cppm | 11 ++ src/beman/execution/sync_wait.cppm | 18 ++ src/beman/execution/tag_of_t.cppm | 11 ++ src/beman/execution/then.cppm | 16 ++ src/beman/execution/transform_sender.cppm | 11 ++ src/beman/execution/type_list.cppm | 11 ++ src/beman/execution/unspecified_promise.cppm | 11 ++ src/beman/execution/unstoppable_token.cppm | 11 ++ src/beman/execution/valid_completion_for.cppm | 11 ++ .../valid_completion_signatures.cppm | 11 ++ src/beman/execution/valid_specialization.cppm | 11 ++ src/beman/execution/value_types_of_t.cppm | 11 ++ src/beman/execution/variant_or_empty.cppm | 12 ++ src/beman/execution/when_all.cppm | 12 ++ .../execution/when_all_with_variant.cppm | 12 ++ src/beman/execution/with_await_transform.cppm | 11 ++ .../execution/with_awaitable_senders.cppm | 11 ++ src/beman/execution/write_env.cppm | 12 ++ tests/beman/execution/CMakeLists.txt | 10 +- tests/beman/execution/exec-just.test.cpp | 4 +- tests/beman/execution/exec-snd-expos.test.cpp | 1 + .../execution/include/test/thread_pool.hpp | 1 + 340 files changed, 4317 insertions(+), 1429 deletions(-) create mode 100644 src/beman/execution/affine_on.cppm create mode 100644 src/beman/execution/allocator_aware_move.cppm create mode 100644 src/beman/execution/almost_scheduler.cppm create mode 100644 src/beman/execution/apply_sender.cppm create mode 100644 src/beman/execution/as_awaitable.cppm create mode 100644 src/beman/execution/as_except_ptr.cppm create mode 100644 src/beman/execution/as_tuple.cppm create mode 100644 src/beman/execution/associate.cppm create mode 100644 src/beman/execution/atomic_intrusive_stack.cppm create mode 100644 src/beman/execution/await_result_type.cppm create mode 100644 src/beman/execution/await_suspend_result.cppm create mode 100644 src/beman/execution/awaitable_sender.cppm create mode 100644 src/beman/execution/basic_operation.cppm create mode 100644 src/beman/execution/basic_receiver.cppm create mode 100644 src/beman/execution/basic_sender.cppm create mode 100644 src/beman/execution/basic_state.cppm create mode 100644 src/beman/execution/bulk.cppm create mode 100644 src/beman/execution/call_result_t.cppm create mode 100644 src/beman/execution/callable.cppm create mode 100644 src/beman/execution/check_type_alias_exist.cppm create mode 100644 src/beman/execution/child_type.cppm create mode 100644 src/beman/execution/class_type.cppm create mode 100644 src/beman/execution/completion_domain.cppm create mode 100644 src/beman/execution/completion_signature.cppm create mode 100644 src/beman/execution/completion_signatures.cppm create mode 100644 src/beman/execution/completion_signatures_for.cppm create mode 100644 src/beman/execution/completion_signatures_of_t.cppm create mode 100644 src/beman/execution/completion_tag.cppm create mode 100644 src/beman/execution/connect.cppm create mode 100644 src/beman/execution/connect_all.cppm create mode 100644 src/beman/execution/connect_all_result.cppm create mode 100644 src/beman/execution/connect_awaitable.cppm create mode 100644 src/beman/execution/connect_result_t.cppm create mode 100644 src/beman/execution/continues_on.cppm create mode 100644 src/beman/execution/counting_scope.cppm create mode 100644 src/beman/execution/counting_scope_base.cppm create mode 100644 src/beman/execution/counting_scope_join.cppm create mode 100644 src/beman/execution/decayed_same_as.cppm create mode 100644 src/beman/execution/decayed_tuple.cppm create mode 100644 src/beman/execution/decayed_type_list.cppm create mode 100644 src/beman/execution/decayed_typeof.cppm create mode 100644 src/beman/execution/decays_to.cppm create mode 100644 src/beman/execution/default_domain.cppm create mode 100644 src/beman/execution/default_impls.cppm create mode 100644 src/beman/execution/emplace_from.cppm create mode 100644 src/beman/execution/env.cppm create mode 100644 src/beman/execution/env_of_t.cppm create mode 100644 src/beman/execution/env_promise.cppm create mode 100644 src/beman/execution/env_type.cppm create mode 100644 src/beman/execution/error_types_of_t.cppm create mode 100644 src/beman/execution/forward_like.cppm create mode 100644 src/beman/execution/forwarding_query.cppm create mode 100644 src/beman/execution/fwd_env.cppm create mode 100644 src/beman/execution/gather_signatures.cppm create mode 100644 src/beman/execution/get_allocator.cppm create mode 100644 src/beman/execution/get_awaiter.cppm create mode 100644 src/beman/execution/get_completion_scheduler.cppm create mode 100644 src/beman/execution/get_completion_signatures.cppm create mode 100644 src/beman/execution/get_delegation_scheduler.cppm create mode 100644 src/beman/execution/get_domain.cppm create mode 100644 src/beman/execution/get_domain_early.cppm create mode 100644 src/beman/execution/get_domain_late.cppm create mode 100644 src/beman/execution/get_env.cppm create mode 100644 src/beman/execution/get_scheduler.cppm create mode 100644 src/beman/execution/get_stop_token.cppm create mode 100644 src/beman/execution/has_as_awaitable.cppm create mode 100644 src/beman/execution/has_completions.cppm create mode 100644 src/beman/execution/immovable.cppm create mode 100644 src/beman/execution/impls_for.cppm create mode 100644 src/beman/execution/indices_for.cppm create mode 100644 src/beman/execution/indirect_meta_apply.cppm create mode 100644 src/beman/execution/inplace_stop_source.cppm create mode 100644 src/beman/execution/into_variant.cppm create mode 100644 src/beman/execution/intrusive_stack.cppm create mode 100644 src/beman/execution/is_awaitable.cppm create mode 100644 src/beman/execution/is_awaiter.cppm create mode 100644 src/beman/execution/join_env.cppm create mode 100644 src/beman/execution/just.cppm create mode 100644 src/beman/execution/let.cppm create mode 100644 src/beman/execution/make_env.cppm create mode 100644 src/beman/execution/make_sender.cppm create mode 100644 src/beman/execution/matching_sig.cppm create mode 100644 src/beman/execution/meta_combine.cppm create mode 100644 src/beman/execution/meta_contain_same.cppm create mode 100644 src/beman/execution/meta_contains.cppm create mode 100644 src/beman/execution/meta_filter.cppm create mode 100644 src/beman/execution/meta_prepend.cppm create mode 100644 src/beman/execution/meta_size.cppm create mode 100644 src/beman/execution/meta_to.cppm create mode 100644 src/beman/execution/meta_transform.cppm create mode 100644 src/beman/execution/meta_unique.cppm create mode 100644 src/beman/execution/movable_value.cppm create mode 100644 src/beman/execution/nested_sender_has_affine_on.cppm create mode 100644 src/beman/execution/never_stop_token.cppm create mode 100644 src/beman/execution/non_assignable.cppm create mode 100644 src/beman/execution/nostopstate.cppm create mode 100644 src/beman/execution/nothrow_callable.cppm create mode 100644 src/beman/execution/notify.cppm create mode 100644 src/beman/execution/on.cppm create mode 100644 src/beman/execution/on_stop_request.cppm create mode 100644 src/beman/execution/operation_state.cppm create mode 100644 src/beman/execution/operation_state_task.cppm create mode 100644 src/beman/execution/product_type.cppm create mode 100644 src/beman/execution/prop.cppm create mode 100644 src/beman/execution/query_with_default.cppm create mode 100644 src/beman/execution/queryable.cppm create mode 100644 src/beman/execution/read_env.cppm create mode 100644 src/beman/execution/receiver.cppm create mode 100644 src/beman/execution/receiver_of.cppm create mode 100644 src/beman/execution/run_loop.cppm create mode 100644 src/beman/execution/sched_attrs.cppm create mode 100644 src/beman/execution/sched_env.cppm create mode 100644 src/beman/execution/schedule.cppm create mode 100644 src/beman/execution/schedule_from.cppm create mode 100644 src/beman/execution/schedule_result_t.cppm create mode 100644 src/beman/execution/scheduler.cppm create mode 100644 src/beman/execution/scheduler_t.cppm create mode 100644 src/beman/execution/scope_token.cppm create mode 100644 src/beman/execution/sender.cppm create mode 100644 src/beman/execution/sender_adaptor.cppm create mode 100644 src/beman/execution/sender_adaptor_closure.cppm create mode 100644 src/beman/execution/sender_awaitable.cppm create mode 100644 src/beman/execution/sender_decompose.cppm create mode 100644 src/beman/execution/sender_for.cppm create mode 100644 src/beman/execution/sender_has_affine_on.cppm create mode 100644 src/beman/execution/sender_in.cppm create mode 100644 src/beman/execution/sends_stopped.cppm create mode 100644 src/beman/execution/set_error.cppm create mode 100644 src/beman/execution/set_stopped.cppm create mode 100644 src/beman/execution/set_value.cppm create mode 100644 src/beman/execution/simple_allocator.cppm create mode 100644 src/beman/execution/simple_counting_scope.cppm create mode 100644 src/beman/execution/single_sender.cppm create mode 100644 src/beman/execution/single_sender_value_type.cppm create mode 100644 src/beman/execution/spawn.cppm create mode 100644 src/beman/execution/spawn_future.cppm create mode 100644 src/beman/execution/spawn_get_allocator.cppm create mode 100644 src/beman/execution/split.cppm create mode 100644 src/beman/execution/start.cppm create mode 100644 src/beman/execution/starts_on.cppm create mode 100644 src/beman/execution/state_type.cppm create mode 100644 src/beman/execution/stop_callback_for_t.cppm create mode 100644 src/beman/execution/stop_source.cppm create mode 100644 src/beman/execution/stop_token_of_t.cppm create mode 100644 src/beman/execution/stop_when.cppm create mode 100644 src/beman/execution/stoppable_source.cppm create mode 100644 src/beman/execution/stoppable_token.cppm create mode 100644 src/beman/execution/suspend_complete.cppm create mode 100644 src/beman/execution/sync_wait.cppm create mode 100644 src/beman/execution/tag_of_t.cppm create mode 100644 src/beman/execution/then.cppm create mode 100644 src/beman/execution/transform_sender.cppm create mode 100644 src/beman/execution/type_list.cppm create mode 100644 src/beman/execution/unspecified_promise.cppm create mode 100644 src/beman/execution/unstoppable_token.cppm create mode 100644 src/beman/execution/valid_completion_for.cppm create mode 100644 src/beman/execution/valid_completion_signatures.cppm create mode 100644 src/beman/execution/valid_specialization.cppm create mode 100644 src/beman/execution/value_types_of_t.cppm create mode 100644 src/beman/execution/variant_or_empty.cppm create mode 100644 src/beman/execution/when_all.cppm create mode 100644 src/beman/execution/when_all_with_variant.cppm create mode 100644 src/beman/execution/with_await_transform.cppm create mode 100644 src/beman/execution/with_awaitable_senders.cppm create mode 100644 src/beman/execution/write_env.cppm diff --git a/bin/mk-module.py b/bin/mk-module.py index ddad4234..c0c44feb 100755 --- a/bin/mk-module.py +++ b/bin/mk-module.py @@ -167,6 +167,7 @@ def get_dependencies(component): def write_header(to, header): filename = f"include/{header}.hpp" + print(f"writing {filename}...") with open(filename) as file: number = 0 for line in file.readlines(): diff --git a/include/beman/execution/detail/affine_on.hpp b/include/beman/execution/detail/affine_on.hpp index d86d0164..8dbc301d 100644 --- a/include/beman/execution/detail/affine_on.hpp +++ b/include/beman/execution/detail/affine_on.hpp @@ -5,6 +5,16 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_AFFINE_ON #include +#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.env import beman.execution.detail.forward_like import beman.execution.detail.fwd_env import beman.execution.detail.get_domain_early import beman.execution.detail.get_scheduler import beman.execution.detail.get_stop_token import beman.execution.detail.join_env import beman.execution.detail.make_sender import beman.execution.detail.never_stop_token import beman.execution.detail.prop import beman.execution.detail.schedule_from import beman.execution.detail.scheduler import beman.execution.detail.sender import beman.execution.detail.sender_adaptor import beman.execution.detail.sender_adaptor_closure import beman.execution.detail.sender_for import beman.execution.detail.sender_has_affine_on import beman.execution.detail.tag_of_t import beman.execution.detail.transform_sender import beman.execution.detail.write_env +#else #include #include #include @@ -25,21 +35,14 @@ #include #include #include +#endif -#include -#include + // ---------------------------------------------------------------------------- -#include - -// ---------------------------------------------------------------------------- - -namespace beman::execution::detail { -template -struct affine_on_env { - Ev ev_; - auto query(const ::beman::execution::get_stop_token_t&) const noexcept -> ::beman::execution::never_stop_token { - return ::beman::execution::never_stop_token(); - } + namespace beman::execution::detail { template struct affine_on_env { Ev ev_; +auto query(const ::beman::execution::get_stop_token_t&) const noexcept -> ::beman::execution::never_stop_token { + return ::beman::execution::never_stop_token(); +} template auto query(const Q& q) const noexcept -> decltype(q(this->ev_)) { return q(this->ev_); diff --git a/include/beman/execution/detail/allocator_aware_move.hpp b/include/beman/execution/detail/allocator_aware_move.hpp index 4b4db2ad..cce0c051 100644 --- a/include/beman/execution/detail/allocator_aware_move.hpp +++ b/include/beman/execution/detail/allocator_aware_move.hpp @@ -4,26 +4,33 @@ #ifndef INCLUDED_BEMAN_EXECUTION_DETAIL_ALLOCATOR_AWARE_MOVE #define INCLUDED_BEMAN_EXECUTION_DETAIL_ALLOCATOR_AWARE_MOVE -#include -#include -#include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include #include +#endif -// ---------------------------------------------------------------------------- +#include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.get_allocator import beman.execution.detail.get_env import beman.execution.detail.product_type +#else +#include +#include +#include +#endif -namespace beman::execution::detail { -template -/*! + // ---------------------------------------------------------------------------- + + namespace beman::execution::detail { template + /*! * \brief Utility function use to move a possibly allocator aware object with an allocator from an environment. * \headerfile beman/execution/execution.hpp * \internal */ -auto allocator_aware_move(T&& obj, Context&& context) noexcept -> decltype(auto) { - try { - if constexpr (requires { ::beman::execution::get_allocator(::beman::execution::get_env(context)); }) { + auto allocator_aware_move(T && obj, Context && context) noexcept->decltype(auto) { try { if constexpr (requires { ::beman::execution::get_allocator(::beman::execution::get_env(context)); +}) { if constexpr (decltype(::beman::execution::detail::is_product_type(obj))()) { return obj.make_from(::beman::execution::get_allocator(::beman::execution::get_env(context)), ::std::forward(obj)); @@ -31,9 +38,10 @@ auto allocator_aware_move(T&& obj, Context&& context) noexcept -> decltype(auto) return ::std::make_obj_using_allocator( ::beman::execution::get_allocator(::beman::execution::get_env(context)), ::std::forward(obj)); } - } else { - return ::std::forward(obj); - } +} +else { + return ::std::forward(obj); +} } catch (...) { ::std::terminate(); //-dk:TODO investigate if that can be avoided } diff --git a/include/beman/execution/detail/almost_scheduler.hpp b/include/beman/execution/detail/almost_scheduler.hpp index bc418175..bde2b3b2 100644 --- a/include/beman/execution/detail/almost_scheduler.hpp +++ b/include/beman/execution/detail/almost_scheduler.hpp @@ -5,31 +5,32 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_ALMOST_SCHEDULER #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.queryable import beman.execution.detail.schedule import beman.execution.detail.scheduler_t import beman.execution.detail.sender +#else #include #include #include #include -#include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Auxiliary concept used to break cycle for scheduler concept. * \headerfile beman/execution/execution.hpp * \internal * \concept almost_scheduler */ -template -concept almost_scheduler = ::std::derived_from::scheduler_concept, - ::beman::execution::scheduler_t> && - ::beman::execution::detail::queryable && - requires(Scheduler&& sched) { - { - ::beman::execution::schedule(::std::forward(sched)) - } -> ::beman::execution::sender; - } && ::std::equality_comparable<::std::remove_cvref_t> && + template concept almost_scheduler = ::std::derived_from ::scheduler_concept, ::beman::execution::scheduler_t> && ::beman::execution::detail::queryable && requires(Scheduler && sched) { { ::beman::execution::schedule(::std::forward (sched)) }->::beman::execution::sender; +} && ::std::equality_comparable<::std::remove_cvref_t> && ::std::copy_constructible<::std::remove_cvref_t>; } // namespace beman::execution::detail diff --git a/include/beman/execution/detail/apply_sender.hpp b/include/beman/execution/detail/apply_sender.hpp index 2c079a5e..60d9e2d6 100644 --- a/include/beman/execution/detail/apply_sender.hpp +++ b/include/beman/execution/detail/apply_sender.hpp @@ -5,21 +5,28 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_APPLY_SENDER #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.default_domain import beman.execution.detail.sender +#else #include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -/*! + namespace beman::execution { + /*! * \brief Function used to transform a sender and its arguments for a domain. * \headerfile beman/execution/execution.hpp */ -template - requires requires(Domain domain, Tag tag, Sender&& sender, Args&&... args) { - domain.apply_sender(Tag(), ::std::forward(sender), ::std::forward(args)...); - } + template + requires requires(Domain domain, Tag tag, Sender && sender, Args &&...args) { domain.apply_sender(Tag(), ::std::forward (sender), ::std::forward (args)...); +} constexpr auto apply_sender(Domain domain, Tag, Sender&& sender, Args&&... args) noexcept(noexcept( domain.apply_sender(Tag(), ::std::forward(sender), ::std::forward(args)...))) -> decltype(auto) { return domain.apply_sender(Tag(), ::std::forward(sender), ::std::forward(args)...); diff --git a/include/beman/execution/detail/as_awaitable.hpp b/include/beman/execution/detail/as_awaitable.hpp index 68fa058a..e0ade721 100644 --- a/include/beman/execution/detail/as_awaitable.hpp +++ b/include/beman/execution/detail/as_awaitable.hpp @@ -5,38 +5,44 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_AS_AWAITABLE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.awaitable_sender import beman.execution.detail.is_awaitable import beman.execution.detail.sender_awaitable import beman.execution.detail.unspecified_promise +#else #include #include #include #include +#endif -#include -#include -#include - -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -/*! + namespace beman::execution { + /*! * \brief Turn an entity, e.g., a sender, into an awaitable. * \headerfile beman/execution/execution.hpp */ -struct as_awaitable_t { - template - auto operator()(Expr&& expr, Promise& promise) const { - if constexpr (requires { ::std::forward(expr).as_awaitable(promise); }) { + struct as_awaitable_t { template auto operator()(Expr && expr, Promise & promise) const { if constexpr (requires { ::std::forward (expr).as_awaitable(promise); +}) { static_assert( ::beman::execution::detail::is_awaitable(expr).as_awaitable(promise)), Promise>, "as_awaitable must return an awaitable"); return ::std::forward(expr).as_awaitable(promise); - } else if constexpr (::beman::execution::detail:: - is_awaitable || - !::beman::execution::detail::awaitable_sender) { - return ::std::forward(expr); - } else { - return ::beman::execution::detail::sender_awaitable{::std::forward(expr), promise}; - } +} +else if constexpr (::beman::execution::detail::is_awaitable || + !::beman::execution::detail::awaitable_sender) { + return ::std::forward(expr); +} +else { + return ::beman::execution::detail::sender_awaitable{::std::forward(expr), promise}; +} } }; inline constexpr ::beman::execution::as_awaitable_t as_awaitable{}; diff --git a/include/beman/execution/detail/as_except_ptr.hpp b/include/beman/execution/detail/as_except_ptr.hpp index c14d5633..e54b3359 100644 --- a/include/beman/execution/detail/as_except_ptr.hpp +++ b/include/beman/execution/detail/as_except_ptr.hpp @@ -5,12 +5,16 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_AS_EXCEPT_PTR #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include #include #include #include #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/as_tuple.hpp b/include/beman/execution/detail/as_tuple.hpp index b00c530c..2b09f4fb 100644 --- a/include/beman/execution/detail/as_tuple.hpp +++ b/include/beman/execution/detail/as_tuple.hpp @@ -5,17 +5,20 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_AS_TUPLE #include +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.decayed_tuple +#else #include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Turn a completion signatures into a std::tuple type. * \internal */ -template -struct as_tuple; + template struct as_tuple; /*! * \brief The actual operational partial specialization of as_tuple. * \internal diff --git a/include/beman/execution/detail/associate.hpp b/include/beman/execution/detail/associate.hpp index 0eea2a34..c15dbe29 100644 --- a/include/beman/execution/detail/associate.hpp +++ b/include/beman/execution/detail/associate.hpp @@ -5,20 +5,30 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_ASSOCIATE #include -#include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.connect import beman.execution.detail.default_impls import beman.execution.detail.get_domain_early import beman.execution.detail.impls_for import beman.execution.detail.make_sender import beman.execution.detail.nothrow_callable import beman.execution.detail.scope_token import beman.execution.detail.sender import beman.execution.detail.transform_sender +#else #include -#include -#include -#include -#include #include +#include #include +#include +#include +#include +#include #include -#include -#include +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- namespace beman::execution::detail { template <::beman::execution::scope_token Token, ::beman::execution::sender Sender> @@ -66,12 +76,14 @@ struct associate_data { auto release() && noexcept -> ::std::pair { return {::std::move(assoc), sender_ref{assoc ? ::std::addressof(this->sender) : nullptr}}; } +} assoc_t assoc; union { wrap_sender sender; }; }; + template <::beman::execution::scope_token Token, ::beman::execution::sender Sender> associate_data(Token, Sender&&) -> associate_data; diff --git a/include/beman/execution/detail/atomic_intrusive_stack.hpp b/include/beman/execution/detail/atomic_intrusive_stack.hpp index 38cf748e..4e9d023d 100644 --- a/include/beman/execution/detail/atomic_intrusive_stack.hpp +++ b/include/beman/execution/detail/atomic_intrusive_stack.hpp @@ -5,16 +5,22 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_ATOMIC_INTRUSIVE_STACK #include -#include - +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.intrusive_stack +#else +#include +#endif -namespace beman::execution::detail { + namespace beman::execution::detail { -template -class atomic_intrusive_stack; + template class atomic_intrusive_stack; //! @brief This data structure is an intrusive stack that can be used in a lock-free manner. //! diff --git a/include/beman/execution/detail/await_result_type.hpp b/include/beman/execution/detail/await_result_type.hpp index c5d959c3..0b17e78e 100644 --- a/include/beman/execution/detail/await_result_type.hpp +++ b/include/beman/execution/detail/await_result_type.hpp @@ -5,20 +5,27 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_AWAIT_RESULT_TYPE #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.get_awaiter +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Auxiliary type alias to get the result type of an awaiter. * \headerfile beman/execution/execution.hpp * \internal */ -template //-dk:TODO detail export -using await_result_type = - decltype(::beman::execution::detail::get_awaiter(::std::declval(), ::std::declval()).await_resume()); + template //-dk:TODO detail export + using await_result_type = decltype(::beman::execution::detail::get_awaiter(::std::declval (), ::std::declval ()).await_resume()); } // namespace beman::execution::detail // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/await_suspend_result.hpp b/include/beman/execution/detail/await_suspend_result.hpp index 2c21427b..210c8ecc 100644 --- a/include/beman/execution/detail/await_suspend_result.hpp +++ b/include/beman/execution/detail/await_suspend_result.hpp @@ -5,9 +5,13 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_AWAIT_SUSPEND_RESULT #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/awaitable_sender.hpp b/include/beman/execution/detail/awaitable_sender.hpp index 069dd06e..535c090a 100644 --- a/include/beman/execution/detail/awaitable_sender.hpp +++ b/include/beman/execution/detail/awaitable_sender.hpp @@ -5,18 +5,21 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_AWAITABLE_SENDER #include -#include -#include - +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.env_of_t import beman.execution.detail.single_sender +#else +#include +#include +#endif -namespace beman::execution::detail { -template -concept awaitable_sender = - ::beman::execution::detail::single_sender> && requires(Promise& prom) { - { prom.unhandled_stopped() } -> ::std::convertible_to<::std::coroutine_handle<>>; - }; + namespace beman::execution::detail { template concept awaitable_sender = ::beman::execution::detail::single_sender > && requires(Promise & prom) { { prom.unhandled_stopped() }->::std::convertible_to <::std::coroutine_handle<>>; +}; } // namespace beman::execution::detail #endif // INCLUDED_BEMAN_EXECUTION_DETAIL_AWAITABLE_SENDER diff --git a/include/beman/execution/detail/basic_operation.hpp b/include/beman/execution/detail/basic_operation.hpp index 8ba4fdb1..a27760e0 100644 --- a/include/beman/execution/detail/basic_operation.hpp +++ b/include/beman/execution/detail/basic_operation.hpp @@ -5,62 +5,70 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_BASIC_OPERATION #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.basic_state import beman.execution.detail.connect_all_result import beman.execution.detail.impls_for import beman.execution.detail.operation_state import beman.execution.detail.sender_decompose import beman.execution.detail.start import beman.execution.detail.state_type import beman.execution.detail.tag_of_t import beman.execution.detail.valid_specialization +#else #include -#include +#include +#include +#include #include +#include +#include #include -#include -#include #include -#include -#include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Class template use to factor out common operation state needs. * \headerfile beman/execution/execution.hpp * \internal */ -//-dk:TODO the export below shouldn't be needed, but MSVC++ seems to require it (2026-02-01) -template //-dk:TODO detail export - requires ::beman::execution::detail:: - //-dk:TODO why is the remove_cvref_t needed...? - valid_specialization<::beman::execution::detail::state_type, std::remove_cvref_t, Receiver> -struct basic_operation : ::beman::execution::detail::basic_state { - // static_assert(std::same_as>); - friend struct ::beman::execution::start_t; - using operation_state_concept = ::beman::execution::operation_state_t; - using tag_t = ::beman::execution::tag_of_t; + //-dk:TODO the export below shouldn't be needed, but MSVC++ seems to require it (2026-02-01) + template //-dk:TODO detail export + requires ::beman::execution::detail:: + //-dk:TODO why is the remove_cvref_t needed...? + valid_specialization <::beman::execution::detail::state_type, std::remove_cvref_t, Receiver> + struct basic_operation: ::beman::execution::detail::basic_state { + // static_assert(std::same_as>); + friend struct ::beman::execution::start_t; +using operation_state_concept = ::beman::execution::operation_state_t; +using tag_t = ::beman::execution::tag_of_t; - using inner_ops_t = ::beman::execution::detail::connect_all_result; - inner_ops_t inner_ops; +using inner_ops_t = ::beman::execution::detail::connect_all_result; +inner_ops_t inner_ops; - basic_operation(Sender&& sender, Receiver&& rcvr) noexcept( - noexcept(::beman::execution::detail::basic_state(::std::forward(sender), - ::std::move(rcvr))) && - noexcept(::beman::execution::detail::connect_all(this, - ::std::forward(sender), - ::beman::execution::detail::indices_for()))) - : ::beman::execution::detail::basic_state(::std::forward(sender), ::std::move(rcvr)), - // NOLINTBEGIN(bugprone-use-after-move,hicpp-invalid-access-moved) - //-dk:TODO deal with moving the sender twice - inner_ops(::beman::execution::detail::connect_all( - this, ::std::forward(sender), ::beman::execution::detail::indices_for())) {} - // NOLINTEND(bugprone-use-after-move,hicpp-invalid-access-moved) +basic_operation(Sender&& sender, Receiver&& rcvr) noexcept( + noexcept(::beman::execution::detail::basic_state(::std::forward(sender), + ::std::move(rcvr))) && + noexcept(::beman::execution::detail::connect_all(this, + ::std::forward(sender), + ::beman::execution::detail::indices_for()))) + : ::beman::execution::detail::basic_state(::std::forward(sender), ::std::move(rcvr)), + // NOLINTBEGIN(bugprone-use-after-move,hicpp-invalid-access-moved) + //-dk:TODO deal with moving the sender twice + inner_ops(::beman::execution::detail::connect_all( + this, ::std::forward(sender), ::beman::execution::detail::indices_for())) {} +// NOLINTEND(bugprone-use-after-move,hicpp-invalid-access-moved) - private: - auto start() & noexcept -> void { - ::std::invoke( - [this]<::std::size_t... I>(::std::index_sequence) { - ::beman::execution::detail::impls_for::start( - this->state, this->receiver, this->inner_ops.template get()...); - }, - ::std::make_index_sequence{}); - } +private: +auto start() & noexcept -> void { + ::std::invoke( + [this]<::std::size_t... I>(::std::index_sequence) { + ::beman::execution::detail::impls_for::start( + this->state, this->receiver, this->inner_ops.template get()...); + }, + ::std::make_index_sequence{}); +} }; template basic_operation(Sender&&, Receiver&&) -> basic_operation; diff --git a/include/beman/execution/detail/basic_receiver.hpp b/include/beman/execution/detail/basic_receiver.hpp index 1a3cd47b..de0b3e76 100644 --- a/include/beman/execution/detail/basic_receiver.hpp +++ b/include/beman/execution/detail/basic_receiver.hpp @@ -5,56 +5,62 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_BASIC_RECEIVER #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.basic_state import beman.execution.detail.callable import beman.execution.detail.env_type import beman.execution.detail.get_env import beman.execution.detail.impls_for import beman.execution.detail.receiver import beman.execution.detail.sender_decompose import beman.execution.detail.set_error import beman.execution.detail.set_stopped import beman.execution.detail.set_value import beman.execution.detail.state_type import beman.execution.detail.tag_of_t import beman.execution.detail.valid_specialization +#else #include #include #include +#include #include #include #include -#include -#include -#include -#include #include #include #include -#include +#include +#include +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Class template used as receiver for child completions for library senders. * \headerfile beman/execution/execution.hpp * \internal */ -template - requires ::beman::execution::detail:: - valid_specialization<::beman::execution::detail::env_type, Index, Sender, Receiver> - struct basic_receiver { - friend struct ::beman::execution::get_env_t; - friend struct ::beman::execution::set_error_t; - friend struct ::beman::execution::set_stopped_t; - friend struct ::beman::execution::set_value_t; + template + requires ::beman::execution::detail::valid_specialization <::beman::execution::detail::env_type, Index, Sender, Receiver> + struct basic_receiver { friend struct ::beman::execution::get_env_t; +friend struct ::beman::execution::set_error_t; +friend struct ::beman::execution::set_stopped_t; +friend struct ::beman::execution::set_value_t; - using receiver_concept = ::beman::execution::receiver_t; - using tag_t = ::beman::execution::tag_of_t; - using state_t = ::beman::execution::detail::state_type; - static constexpr const auto& complete = ::beman::execution::detail::impls_for::complete; - ::beman::execution::detail::basic_state* op{}; +using receiver_concept = ::beman::execution::receiver_t; +using tag_t = ::beman::execution::tag_of_t; +using state_t = ::beman::execution::detail::state_type; +static constexpr const auto& complete = ::beman::execution::detail::impls_for::complete; +::beman::execution::detail::basic_state* op{}; - private: - template - auto set_value(Args&&... args) && noexcept -> void - requires ::beman::execution::detail:: - callable - { - this->complete(Index(), - this->op->state, - this->op->receiver, - ::beman::execution::set_value_t(), - ::std::forward(args)...); - } +private: +template +auto set_value(Args&&... args) && noexcept -> void + requires ::beman::execution::detail:: + callable +{ + this->complete(Index(), + this->op->state, + this->op->receiver, + ::beman::execution::set_value_t(), + ::std::forward(args)...); +} template auto set_error(Error&& error) && noexcept -> void diff --git a/include/beman/execution/detail/basic_sender.hpp b/include/beman/execution/detail/basic_sender.hpp index 62bba28a..c70d5b7a 100644 --- a/include/beman/execution/detail/basic_sender.hpp +++ b/include/beman/execution/detail/basic_sender.hpp @@ -5,39 +5,45 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_BASIC_SENDER #include +#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.basic_operation import beman.execution.detail.completion_signatures_for import beman.execution.detail.connect import beman.execution.detail.decays_to import beman.execution.detail.get_completion_signatures import beman.execution.detail.impls_for import beman.execution.detail.product_type import beman.execution.detail.sender import beman.execution.detail.sender_decompose +#else #include #include +#include #include +#include #include #include #include #include -#include -#include -#include - -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Class template used to factor out common sender implementation for library senders. * \headerfile beman/execution/execution.hpp * \internal */ -template -struct basic_sender : ::beman::execution::detail::product_type { - //-dk:TODO friend struct ::beman::execution::detail::connect_t; - //-dk:TODO friend struct ::beman::execution::get_completion_signatures_t; - using sender_concept = ::beman::execution::sender_t; - using indices_for = ::std::index_sequence_for; + template struct basic_sender: ::beman::execution::detail::product_type { + //-dk:TODO friend struct ::beman::execution::detail::connect_t; + //-dk:TODO friend struct ::beman::execution::get_completion_signatures_t; + using sender_concept = ::beman::execution::sender_t; +using indices_for = ::std::index_sequence_for; - auto get_env() const noexcept -> decltype(auto) { - auto&& d{this->template get<1>()}; - return sub_apply<2>( - [&d](auto&&... c) { return ::beman::execution::detail::impls_for::get_attrs(d, c...); }, *this); - } +auto get_env() const noexcept -> decltype(auto) { + auto&& d{this->template get<1>()}; + return sub_apply<2>([&d](auto&&... c) { return ::beman::execution::detail::impls_for::get_attrs(d, c...); }, + *this); +} template requires(!::beman::execution::receiver) diff --git a/include/beman/execution/detail/basic_state.hpp b/include/beman/execution/detail/basic_state.hpp index 128fb7a6..8d52118e 100644 --- a/include/beman/execution/detail/basic_state.hpp +++ b/include/beman/execution/detail/basic_state.hpp @@ -5,31 +5,35 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_BASIC_STATE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.impls_for import beman.execution.detail.sender_decompose import beman.execution.detail.state_type import beman.execution.detail.tag_of_t +#else #include #include -#include #include -#include -#include +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Class template used to present the receiver and operation state for library senders. * \headerfile beman/execution/execution.hpp * \internal */ -//-dk:TODO the export below shouldn't be needed, but MSVC++ seems to require it (2026-02-01) -template //-dk:TODO detail export -struct basic_state { - basic_state(Sender&& sender, Receiver&& rcvr) noexcept(true) - : receiver(::std::move(rcvr)), - state(::beman::execution::detail::impls_for<::beman::execution::tag_of_t>::get_state( - ::std::forward(sender), this->receiver)) {} + //-dk:TODO the export below shouldn't be needed, but MSVC++ seems to require it (2026-02-01) + template //-dk:TODO detail export + struct basic_state { basic_state(Sender && sender, Receiver && rcvr) noexcept(true) :receiver(::std::move(rcvr)), state(::beman::execution::detail::impls_for <::beman::execution::tag_of_t> ::get_state(::std::forward (sender), this->receiver)) {} - Receiver receiver; - ::beman::execution::detail::state_type state; + Receiver receiver; +::beman::execution::detail::state_type state; }; template basic_state(Sender&&, Receiver&&) -> basic_state; diff --git a/include/beman/execution/detail/bulk.hpp b/include/beman/execution/detail/bulk.hpp index cdcc896d..c1566518 100644 --- a/include/beman/execution/detail/bulk.hpp +++ b/include/beman/execution/detail/bulk.hpp @@ -5,40 +5,46 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_BULK #include -#include -#include -#include -#include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.basic_sender import beman.execution.detail.completion_signatures import beman.execution.detail.completion_signatures_for import beman.execution.detail.default_impls import beman.execution.detail.get_completion_signatures import beman.execution.detail.get_domain_early import beman.execution.detail.impls_for import beman.execution.detail.make_sender import beman.execution.detail.meta_combine import beman.execution.detail.meta_unique import beman.execution.detail.movable_value import beman.execution.detail.product_type import beman.execution.detail.sender import beman.execution.detail.sender_adaptor import beman.execution.detail.sender_adaptor_closure import beman.execution.detail.set_error import beman.execution.detail.set_value import beman.execution.detail.transform_sender +#else #include #include #include +#include +#include #include +#include #include +#include +#include #include #include #include +#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include +#include +#endif -#include -namespace beman::execution::detail { + namespace beman::execution::detail { -struct bulk_t : ::beman::execution::sender_adaptor_closure { + struct bulk_t: ::beman::execution::sender_adaptor_closure { - template - requires(std::is_integral_v && ::beman::execution::detail::movable_value) - auto operator()(Shape&& shape, f&& fun) const { - return beman::execution::detail::sender_adaptor{*this, std::forward(shape), std::forward(fun)}; - } + template + requires(std::is_integral_v && ::beman::execution::detail::movable_value ) + auto operator()(Shape && shape, f && fun) const { return beman::execution::detail::sender_adaptor{* this, std::forward (shape), std::forward (fun) }; +} template requires(::beman::execution::sender && std::is_integral_v && diff --git a/include/beman/execution/detail/call_result_t.hpp b/include/beman/execution/detail/call_result_t.hpp index ab681798..19aaa2a6 100644 --- a/include/beman/execution/detail/call_result_t.hpp +++ b/include/beman/execution/detail/call_result_t.hpp @@ -5,7 +5,11 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CALL_RESULT #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/callable.hpp b/include/beman/execution/detail/callable.hpp index f6a9122f..3483fb02 100644 --- a/include/beman/execution/detail/callable.hpp +++ b/include/beman/execution/detail/callable.hpp @@ -5,7 +5,11 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CALLABLE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/check_type_alias_exist.hpp b/include/beman/execution/detail/check_type_alias_exist.hpp index e609a8e8..9f743fa9 100644 --- a/include/beman/execution/detail/check_type_alias_exist.hpp +++ b/include/beman/execution/detail/check_type_alias_exist.hpp @@ -5,6 +5,10 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CHECK_TYPE_ALIAS_EXIST #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/child_type.hpp b/include/beman/execution/detail/child_type.hpp index 63fd1c71..4843bc67 100644 --- a/include/beman/execution/detail/child_type.hpp +++ b/include/beman/execution/detail/child_type.hpp @@ -5,8 +5,12 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CHILD_TYPE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/class_type.hpp b/include/beman/execution/detail/class_type.hpp index c92cf5d2..8c6eacf2 100644 --- a/include/beman/execution/detail/class_type.hpp +++ b/include/beman/execution/detail/class_type.hpp @@ -5,19 +5,26 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CLASS_TYPE #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.decays_to +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Auxiliary concept used to detect class types. [execution.syn#concept:class-type] * \headerfile beman/execution/execution.hpp * \internal */ -template -concept class_type = ::beman::execution::detail::decays_to && ::std::is_class_v; + template concept class_type = ::beman::execution::detail::decays_to && ::std::is_class_v ; } // namespace beman::execution::detail // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/completion_domain.hpp b/include/beman/execution/detail/completion_domain.hpp index ebc87003..8f138698 100644 --- a/include/beman/execution/detail/completion_domain.hpp +++ b/include/beman/execution/detail/completion_domain.hpp @@ -5,17 +5,24 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COMPLETION_DOMAIN #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.default_domain import beman.execution.detail.get_completion_scheduler import beman.execution.detail.get_domain import beman.execution.detail.get_env import beman.execution.detail.sender +#else #include -#include #include +#include #include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -struct completion_domain_undefined {}; + namespace beman::execution::detail { struct completion_domain_undefined {}; template struct completion_domain_merge {}; template diff --git a/include/beman/execution/detail/completion_signature.hpp b/include/beman/execution/detail/completion_signature.hpp index 11b06b7b..0610fd94 100644 --- a/include/beman/execution/detail/completion_signature.hpp +++ b/include/beman/execution/detail/completion_signature.hpp @@ -5,16 +5,22 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COMPLETION_SIGNATURE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.set_error import beman.execution.detail.set_stopped import beman.execution.detail.set_value +#else #include #include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -struct is_set_error : ::std::false_type {}; + namespace beman::execution::detail { template struct is_set_error: ::std::false_type {}; template struct is_set_error<::beman::execution::set_error_t(Error)> : ::std::true_type {}; diff --git a/include/beman/execution/detail/completion_signatures.hpp b/include/beman/execution/detail/completion_signatures.hpp index 0da03b1d..bbb80799 100644 --- a/include/beman/execution/detail/completion_signatures.hpp +++ b/include/beman/execution/detail/completion_signatures.hpp @@ -5,14 +5,22 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COMPLETION_SIGNATURES #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.completion_signature +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -/*! + namespace beman::execution { + /*! * \brief Class template used to a specify a list of completion signatures * \headerfile beman/execution/execution.hpp * @@ -21,8 +29,7 @@ namespace beman::execution { * any specializaion are empty. Objects may be created to return them from * functions used for type computations like get_completion_signatures(sender, env). */ -template <::beman::execution::detail::completion_signature...> -struct completion_signatures {}; + template <::beman::execution::detail::completion_signature...> struct completion_signatures {}; } // namespace beman::execution // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/completion_signatures_for.hpp b/include/beman/execution/detail/completion_signatures_for.hpp index b0b09530..632f925a 100644 --- a/include/beman/execution/detail/completion_signatures_for.hpp +++ b/include/beman/execution/detail/completion_signatures_for.hpp @@ -5,21 +5,29 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COMPLETION_SIGNATURES_FOR #include -#include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include #include #include -#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.get_completion_signatures import beman.execution.detail.sender_in +#else +#include +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Tag type used to determine if completion signatures were defined. * \headerfile beman/execution/execution.hpp * \internal */ -struct no_completion_signatures_defined_in_sender {}; + struct no_completion_signatures_defined_in_sender {}; /*! * \brief Primary template declaration for the customization of sender completion signatures. diff --git a/include/beman/execution/detail/completion_signatures_of_t.hpp b/include/beman/execution/detail/completion_signatures_of_t.hpp index 2336713c..2aaf1163 100644 --- a/include/beman/execution/detail/completion_signatures_of_t.hpp +++ b/include/beman/execution/detail/completion_signatures_of_t.hpp @@ -5,22 +5,28 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COMPLETION_SIGNATURES_OF #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.call_result_t import beman.execution.detail.env import beman.execution.detail.get_completion_signatures import beman.execution.detail.sender_in +#else #include #include #include #include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -/*! + namespace beman::execution { + /*! * \brief Alias to access the completion signatures of a sender * \headerfile beman/execution/execution.hpp */ -template > - requires ::beman::execution::sender_in -using completion_signatures_of_t = - ::beman::execution::detail::call_result_t<::beman::execution::get_completion_signatures_t, Sender, Env>; + template > + requires ::beman::execution::sender_in + using completion_signatures_of_t = ::beman::execution::detail::call_result_t <::beman::execution::get_completion_signatures_t, Sender, Env>; } // namespace beman::execution // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/completion_tag.hpp b/include/beman/execution/detail/completion_tag.hpp index 6376724b..6683a26b 100644 --- a/include/beman/execution/detail/completion_tag.hpp +++ b/include/beman/execution/detail/completion_tag.hpp @@ -5,23 +5,28 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COMPLETION_TAG #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.set_error import beman.execution.detail.set_stopped import beman.execution.detail.set_value +#else #include #include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief A helper concept used to determine if a type is one of the completion tags. * \headerfile beman/execution/execution.hpp * \internal */ -template -concept completion_tag = - ::std::same_as || ::std::same_as || - ::std::same_as; + template concept completion_tag = ::std::same_as || ::std::same_as || ::std::same_as ; } // namespace beman::execution::detail // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/connect.hpp b/include/beman/execution/detail/connect.hpp index d7584bd3..f573a1fc 100644 --- a/include/beman/execution/detail/connect.hpp +++ b/include/beman/execution/detail/connect.hpp @@ -5,35 +5,35 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CONNECT #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.connect_awaitable import beman.execution.detail.get_domain_late import beman.execution.detail.get_env import beman.execution.detail.operation_state import beman.execution.detail.transform_sender +#else +#include #include #include #include -#include -#include -#include +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief The actual implementation of the connect customization point type * \headerfile beman/execution/execution.hpp * \internal */ -//-dk:TODO this seems to needed for MSVC++ (2026-01-30) -struct connect_t { - private: - template - static auto make_new_sender(Sender&& sender, Receiver&& receiver) - //-dk:TODO this noexcept needs to get confirmed/fixed - noexcept(true) -> decltype(auto) { - return ::beman::execution::transform_sender( - decltype(::beman::execution::detail::get_domain_late(::std::forward(sender), - ::beman::execution::get_env(receiver))){}, - ::std::forward(sender), - ::beman::execution::get_env(receiver)); - } + //-dk:TODO this seems to needed for MSVC++ (2026-01-30) + struct connect_t { private : template static auto make_new_sender(Sender && sender, Receiver && receiver) + //-dk:TODO this noexcept needs to get confirmed/fixed + noexcept(true)->decltype(auto) { return ::beman::execution::transform_sender(decltype(::beman::execution::detail::get_domain_late(::std::forward (sender), ::beman::execution::get_env(receiver))){}, ::std::forward (sender), ::beman::execution::get_env(receiver)); +} template static constexpr auto connect_noexcept() -> bool { if constexpr (requires { diff --git a/include/beman/execution/detail/connect_all.hpp b/include/beman/execution/detail/connect_all.hpp index ec2d3c6e..d038197b 100644 --- a/include/beman/execution/detail/connect_all.hpp +++ b/include/beman/execution/detail/connect_all.hpp @@ -5,35 +5,36 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CONNECT_ALL #include -#include -#include +#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.basic_receiver import beman.execution.detail.basic_state import beman.execution.detail.connect import beman.execution.detail.connect_result_t import beman.execution.detail.forward_like import beman.execution.detail.product_type import beman.execution.detail.sender_decompose +#else #include #include +#include +#include +#include #include #include -#include -#include -#include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -#include - -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief A helper types whose call operator connects all children of a basic_sender * \headerfile beman/execution/execution.hpp * \internal */ -struct connect_all_t { - private: - template - static auto apply_with_index_helper(::std::index_sequence seq, Fun&& fun, Tuple&& tuple) noexcept(noexcept( - ::std::forward(fun)(seq, ::beman::execution::detail::forward_like(::std::get(tuple))...))) - -> decltype(auto) { - return ::std::forward(fun)(seq, ::beman::execution::detail::forward_like(::std::get(tuple))...); - } + struct connect_all_t { private : template static auto apply_with_index_helper(::std::index_sequence seq, Fun && fun, Tuple && tuple) noexcept(noexcept(::std::forward (fun)(seq, ::beman::execution::detail::forward_like (::std::get (tuple))...)))->decltype(auto) { return ::std::forward (fun)(seq, ::beman::execution::detail::forward_like (::std::get (tuple))...); +} template static auto apply_with_index(Fun&& fun, Tuple&& tuple) noexcept( noexcept(apply_with_index_helper(::std::make_index_sequence<::std::tuple_size_v<::std::decay_t>>{}, diff --git a/include/beman/execution/detail/connect_all_result.hpp b/include/beman/execution/detail/connect_all_result.hpp index 0bea8680..7f8a3ce0 100644 --- a/include/beman/execution/detail/connect_all_result.hpp +++ b/include/beman/execution/detail/connect_all_result.hpp @@ -5,25 +5,29 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CONNECT_ALL_RESULT #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.basic_state import beman.execution.detail.call_result_t import beman.execution.detail.connect_all import beman.execution.detail.indices_for +#else #include -#include #include +#include #include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Helper type used to determine the state type when connecting all senders in a basic_sender * \headerfile beman/execution/execution.hpp * \internal */ -template -using connect_all_result = - ::beman::execution::detail::call_result_t*, - Sender, - ::beman::execution::detail::indices_for>; + template using connect_all_result = ::beman::execution::detail::call_result_t *, Sender, ::beman::execution::detail::indices_for >; } // namespace beman::execution::detail // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/connect_awaitable.hpp b/include/beman/execution/detail/connect_awaitable.hpp index d708340d..c57919a1 100644 --- a/include/beman/execution/detail/connect_awaitable.hpp +++ b/include/beman/execution/detail/connect_awaitable.hpp @@ -5,31 +5,36 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CONNECT_AWAITABLE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.await_result_type import beman.execution.detail.completion_signatures import beman.execution.detail.operation_state_task import beman.execution.detail.receiver import beman.execution.detail.receiver_of import beman.execution.detail.set_error import beman.execution.detail.set_stopped import beman.execution.detail.set_value import beman.execution.detail.suspend_complete +#else #include #include #include #include #include -#include #include #include #include +#include +#endif -#include -#include -#include - -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief A helper template used determine the completion signature for type T which may be void * \headerfile beman/execution/execution.hpp * \internal */ -template -struct awaiter_set_value { - using type = ::beman::execution::set_value_t(T); + template struct awaiter_set_value { using type = ::beman::execution::set_value_t(T); }; /*! * \brief Specialization for awaiter_set_value when the type is void diff --git a/include/beman/execution/detail/connect_result_t.hpp b/include/beman/execution/detail/connect_result_t.hpp index f41e9f19..c0706d66 100644 --- a/include/beman/execution/detail/connect_result_t.hpp +++ b/include/beman/execution/detail/connect_result_t.hpp @@ -5,18 +5,25 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CONNECT_RESULT #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.connect +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -/*! + namespace beman::execution { + /*! * \brief Type alias to determine the operation state type returned from `connect()`. * \headerfile beman/execution/execution.hpp */ -template -using connect_result_t = decltype(::beman::execution::connect(::std::declval(), ::std::declval())); + template using connect_result_t = decltype(::beman::execution::connect(::std::declval (), ::std::declval ())); } // namespace beman::execution // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/continues_on.hpp b/include/beman/execution/detail/continues_on.hpp index bbeba96b..883ffa15 100644 --- a/include/beman/execution/detail/continues_on.hpp +++ b/include/beman/execution/detail/continues_on.hpp @@ -5,41 +5,45 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_CONTINUES_ON #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.default_domain import beman.execution.detail.default_impls import beman.execution.detail.fwd_env import beman.execution.detail.get_domain_early import beman.execution.detail.get_domain_late import beman.execution.detail.get_env import beman.execution.detail.impls_for import beman.execution.detail.join_env import beman.execution.detail.make_sender import beman.execution.detail.query_with_default import beman.execution.detail.sched_attrs import beman.execution.detail.schedule_from import beman.execution.detail.scheduler import beman.execution.detail.sender import beman.execution.detail.sender_adaptor import beman.execution.detail.sender_for import beman.execution.detail.transform_sender +#else +#include +#include #include +#include +#include #include -#include #include -#include -#include -#include +#include +#include #include - -#include +#include +#include +#include +#include +#include +#include +#include +#endif // ---------------------------------------------------------------------------- #include -namespace beman::execution::detail { -// specialize default_domain appropriately -/*! + namespace beman::execution::detail { + // specialize default_domain appropriately + /*! * \brief The actual implementation of the continues_on customization point object * \headerfile beman/execution/execution.hpp * \internal */ -struct continues_on_t { - template <::beman::execution::detail::sender_for Sender, typename... Env> - static auto transform_sender(Sender&& sender, Env&&...) { - auto&& data{sender.template get<1>()}; + struct continues_on_t { template <::beman::execution::detail::sender_for Sender, typename...Env> static auto transform_sender(Sender && sender, Env &&...) { auto && data{sender.template get <1>() }; auto&& child{sender.template get<2>()}; return ::beman::execution::schedule_from(std::move(data), std::move(child)); } diff --git a/include/beman/execution/detail/counting_scope.hpp b/include/beman/execution/detail/counting_scope.hpp index a3fae783..8c5618d4 100644 --- a/include/beman/execution/detail/counting_scope.hpp +++ b/include/beman/execution/detail/counting_scope.hpp @@ -5,19 +5,26 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COUNTING_SCOPE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.counting_scope_base import beman.execution.detail.counting_scope_join import beman.execution.detail.inplace_stop_source import beman.execution.detail.scope_token import beman.execution.detail.sender import beman.execution.detail.stop_when +#else #include #include +#include #include #include -#include #include -#include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -class counting_scope; + namespace beman::execution { class counting_scope; } // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/counting_scope_base.hpp b/include/beman/execution/detail/counting_scope_base.hpp index 32eb394b..b8291070 100644 --- a/include/beman/execution/detail/counting_scope_base.hpp +++ b/include/beman/execution/detail/counting_scope_base.hpp @@ -5,16 +5,23 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COUNTING_SCOPE_BASE #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.immovable +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -class counting_scope_base; + namespace beman::execution::detail { class counting_scope_base; } // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/counting_scope_join.hpp b/include/beman/execution/detail/counting_scope_join.hpp index 1bf15008..01504ec6 100644 --- a/include/beman/execution/detail/counting_scope_join.hpp +++ b/include/beman/execution/detail/counting_scope_join.hpp @@ -5,6 +5,14 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COUNTING_SCOPE_JOIN #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.basic_sender import beman.execution.detail.completion_signatures import beman.execution.detail.connect import beman.execution.detail.counting_scope_base import beman.execution.detail.default_impls import beman.execution.detail.get_env import beman.execution.detail.get_scheduler import beman.execution.detail.impls_for import beman.execution.detail.make_sender import beman.execution.detail.receiver import beman.execution.detail.schedule import beman.execution.detail.set_value import beman.execution.detail.start +#else #include #include #include @@ -18,19 +26,15 @@ #include #include #include +#endif -#include + // ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- - -namespace beman::execution::detail { -struct counting_scope_join_t { - template <::beman::execution::receiver> - struct state; + namespace beman::execution::detail { struct counting_scope_join_t { template <::beman::execution::receiver> struct state; - auto operator()(::beman::execution::detail::counting_scope_base* ptr) const { - return ::beman::execution::detail::make_sender(*this, ptr); - } +auto operator()(::beman::execution::detail::counting_scope_base* ptr) const { + return ::beman::execution::detail::make_sender(*this, ptr); +} }; inline constexpr counting_scope_join_t counting_scope_join{}; diff --git a/include/beman/execution/detail/decayed_same_as.hpp b/include/beman/execution/detail/decayed_same_as.hpp index 1ddd6336..38fa74a4 100644 --- a/include/beman/execution/detail/decayed_same_as.hpp +++ b/include/beman/execution/detail/decayed_same_as.hpp @@ -5,7 +5,11 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_DECAYED_SAME_AS #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/decayed_tuple.hpp b/include/beman/execution/detail/decayed_tuple.hpp index c46402cf..009a0409 100644 --- a/include/beman/execution/detail/decayed_tuple.hpp +++ b/include/beman/execution/detail/decayed_tuple.hpp @@ -5,8 +5,12 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_DECAYED_TUPLE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/decayed_type_list.hpp b/include/beman/execution/detail/decayed_type_list.hpp index 81d720cd..5499ef41 100644 --- a/include/beman/execution/detail/decayed_type_list.hpp +++ b/include/beman/execution/detail/decayed_type_list.hpp @@ -5,14 +5,20 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_DECAYED_TYPE_LIST #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.type_list +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -using decayed_type_list = ::beman::execution::detail::type_list<::std::decay_t...>; + namespace beman::execution::detail { template using decayed_type_list = ::beman::execution::detail::type_list <::std::decay_t...>; } // namespace beman::execution::detail // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/decayed_typeof.hpp b/include/beman/execution/detail/decayed_typeof.hpp index f43f1f0c..91e688e5 100644 --- a/include/beman/execution/detail/decayed_typeof.hpp +++ b/include/beman/execution/detail/decayed_typeof.hpp @@ -5,7 +5,11 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_DECAYED_TYPEOF #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/decays_to.hpp b/include/beman/execution/detail/decays_to.hpp index 5dae74b3..5aa47fb9 100644 --- a/include/beman/execution/detail/decays_to.hpp +++ b/include/beman/execution/detail/decays_to.hpp @@ -5,8 +5,12 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_DECAYS_TO #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/default_domain.hpp b/include/beman/execution/detail/default_domain.hpp index bb9c91fc..a778ecbb 100644 --- a/include/beman/execution/detail/default_domain.hpp +++ b/include/beman/execution/detail/default_domain.hpp @@ -5,17 +5,25 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_DEFAULT_DOMAIN #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.queryable import beman.execution.detail.sender import beman.execution.detail.sender_decompose import beman.execution.detail.tag_of_t +#else #include #include #include #include -#include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -/*! + namespace beman::execution { + /*! * \brief Domain type used when no domain is specified explicitly. * \headerfile beman/execution/execution.hpp * @@ -25,12 +33,9 @@ namespace beman::execution { * tag type of the passed sender. If there is no corresponding member function * no transformation is applied. */ -struct default_domain { - template <::beman::execution::sender Sender, ::beman::execution::detail::queryable... Env> - requires(sizeof...(Env) <= 1) && requires(Sender&& sender, Env&&... env) { - ::beman::execution::tag_of_t().transform_sender(::std::forward(sender), - ::std::forward(env)...); - } + struct default_domain { template <::beman::execution::sender Sender, ::beman::execution::detail::queryable... Env> + requires(sizeof...(Env) <= 1) && requires(Sender && sender, Env &&...env) { ::beman::execution::tag_of_t ().transform_sender(::std::forward (sender), ::std::forward (env)...); +} static constexpr auto transform_sender(Sender&& sender, Env&&... env) noexcept( noexcept(::beman::execution::tag_of_t().transform_sender(::std::forward(sender), ::std::forward(env)...))) diff --git a/include/beman/execution/detail/default_impls.hpp b/include/beman/execution/detail/default_impls.hpp index fc705570..7fde8f88 100644 --- a/include/beman/execution/detail/default_impls.hpp +++ b/include/beman/execution/detail/default_impls.hpp @@ -5,6 +5,14 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_DEFAULT_IMPLS #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.allocator_aware_move import beman.execution.detail.callable import beman.execution.detail.env import beman.execution.detail.forward_like import beman.execution.detail.fwd_env import beman.execution.detail.get_allocator import beman.execution.detail.get_env import beman.execution.detail.product_type import beman.execution.detail.sender_decompose import beman.execution.detail.start +#else #include #include #include @@ -15,25 +23,19 @@ #include #include #include +#endif -#include + // ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- - -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Helper type providing default implementations for basic_sender * \headerfile beman/execution/execution.hpp * \internal */ -struct default_impls { - struct get_attrs_impl { - auto operator()(const auto&, const auto&... child) const noexcept -> decltype(auto) { - if constexpr (1 == sizeof...(child)) - return (::beman::execution::detail::fwd_env(::beman::execution::get_env(child)), ...); - else - return ::beman::execution::env<>{}; - } + struct default_impls { struct get_attrs_impl { auto operator()(const auto &, const auto &...child) const noexcept->decltype(auto) { if constexpr (1 == sizeof...(child)) return (::beman::execution::detail::fwd_env(::beman::execution::get_env(child)), ...); +else return ::beman::execution::env<>{}; +} }; static constexpr auto get_attrs = get_attrs_impl{}; struct get_env_impl { diff --git a/include/beman/execution/detail/emplace_from.hpp b/include/beman/execution/detail/emplace_from.hpp index 8c2fa834..7c44e992 100644 --- a/include/beman/execution/detail/emplace_from.hpp +++ b/include/beman/execution/detail/emplace_from.hpp @@ -5,27 +5,33 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_EMPLACE_FROM #include -#include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.call_result_t import beman.execution.detail.nothrow_callable +#else +#include +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Helper class to get the result of a function which may be only called once. * \headerfile beman/execution/execution.hpp * \internal */ -template -struct emplace_from { - using type = ::beman::execution::detail::call_result_t; - Fun fun; + template struct emplace_from { using type = ::beman::execution::detail::call_result_t ; +Fun fun; - explicit constexpr operator type() && noexcept(::beman::execution::detail::nothrow_callable) { - return ::std::move(fun)(); - } +explicit constexpr operator type() && noexcept(::beman::execution::detail::nothrow_callable) { + return ::std::move(fun)(); +} }; template emplace_from(Fun&&) -> emplace_from<::std::remove_cvref_t>; diff --git a/include/beman/execution/detail/env.hpp b/include/beman/execution/detail/env.hpp index 383f00b1..d62cc932 100644 --- a/include/beman/execution/detail/env.hpp +++ b/include/beman/execution/detail/env.hpp @@ -5,16 +5,21 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_ENV #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.non_assignable import beman.execution.detail.queryable +#else #include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template <::beman::execution::detail::queryable Env> -struct env_base { - Env env_; + namespace beman::execution::detail { template <::beman::execution::detail::queryable Env> struct env_base { Env env_; }; template diff --git a/include/beman/execution/detail/env_of_t.hpp b/include/beman/execution/detail/env_of_t.hpp index 0f3e0f8e..c097a27f 100644 --- a/include/beman/execution/detail/env_of_t.hpp +++ b/include/beman/execution/detail/env_of_t.hpp @@ -5,18 +5,25 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_ENV_OF #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.get_env +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -/*! + namespace beman::execution { + /*! * \brief Determine the type of the environment associated with a type * \headerfile beman/execution/execution.hpp */ -template -using env_of_t = decltype(::beman::execution::get_env(::std::declval())); + template using env_of_t = decltype(::beman::execution::get_env(::std::declval ())); } // namespace beman::execution // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/env_promise.hpp b/include/beman/execution/detail/env_promise.hpp index d12b23ea..05760ecc 100644 --- a/include/beman/execution/detail/env_promise.hpp +++ b/include/beman/execution/detail/env_promise.hpp @@ -5,26 +5,33 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_ENV_PROMISE #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.with_await_transform +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief A helper promise type with an associated environment * \headerfile beman/execution/execution.hpp * \internal */ -template //-dk:TODO detail export -struct env_promise : ::beman::execution::detail::with_await_transform { - auto get_return_object() noexcept -> void; - auto initial_suspend() noexcept -> ::std::suspend_always; - auto final_suspend() noexcept -> ::std::suspend_always; - auto unhandled_exception() noexcept -> void; - auto return_void() noexcept -> void; - auto unhandled_stopped() noexcept -> ::std::coroutine_handle<>; - auto get_env() const noexcept -> const Env&; + template //-dk:TODO detail export + struct env_promise: ::beman::execution::detail::with_await_transform { auto get_return_object() noexcept->void; +auto initial_suspend() noexcept -> ::std::suspend_always; +auto final_suspend() noexcept -> ::std::suspend_always; +auto unhandled_exception() noexcept -> void; +auto return_void() noexcept -> void; +auto unhandled_stopped() noexcept -> ::std::coroutine_handle<>; +auto get_env() const noexcept -> const Env&; }; } // namespace beman::execution::detail diff --git a/include/beman/execution/detail/env_type.hpp b/include/beman/execution/detail/env_type.hpp index 4869e4ef..ea50ccb4 100644 --- a/include/beman/execution/detail/env_type.hpp +++ b/include/beman/execution/detail/env_type.hpp @@ -5,26 +5,30 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_ENV_TYPE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.call_result_t import beman.execution.detail.impls_for import beman.execution.detail.sender_decompose import beman.execution.detail.state_type import beman.execution.detail.tag_of_t +#else #include #include #include -#include #include +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief Helper alias to determine the environment type associated with sender in a basic_sender * \headerfile beman/execution/execution.hpp * \internal */ -template -using env_type = ::beman::execution::detail::call_result_t< - decltype(::beman::execution::detail::impls_for<::beman::execution::tag_of_t>::get_env), - Index, - ::beman::execution::detail::state_type&, - const Receiver&>; + template using env_type = ::beman::execution::detail::call_result_t < + decltype(::beman::execution::detail::impls_for<::beman::execution::tag_of_t> ::get_env), Index, ::beman::execution::detail::state_type &, const Receiver&>; } // namespace beman::execution::detail // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/error_types_of_t.hpp b/include/beman/execution/detail/error_types_of_t.hpp index aea141b9..e52e1e58 100644 --- a/include/beman/execution/detail/error_types_of_t.hpp +++ b/include/beman/execution/detail/error_types_of_t.hpp @@ -5,30 +5,34 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_ERROR_TYPES_OF #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.completion_signatures_of_t import beman.execution.detail.env import beman.execution.detail.gather_signatures import beman.execution.detail.sender_in import beman.execution.detail.set_error import beman.execution.detail.variant_or_empty +#else #include #include #include #include #include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -/*! + namespace beman::execution { + /*! * \brief Type alias to get error types for a sender * \headerfile beman/execution/execution.hpp */ -template , - template class Variant = ::beman::execution::detail::variant_or_empty> - requires ::beman::execution::sender_in -using error_types_of_t = - ::beman::execution::detail::gather_signatures<::beman::execution::set_error_t, - ::beman::execution::completion_signatures_of_t, - ::std::type_identity_t, - Variant>; + template , template class Variant = ::beman::execution::detail::variant_or_empty> + requires ::beman::execution::sender_in + using error_types_of_t = ::beman::execution::detail::gather_signatures <::beman::execution::set_error_t, + ::beman::execution::completion_signatures_of_t, ::std::type_identity_t, Variant>; } // namespace beman::execution // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/forward_like.hpp b/include/beman/execution/detail/forward_like.hpp index 7aa95fb3..a3a9896f 100644 --- a/include/beman/execution/detail/forward_like.hpp +++ b/include/beman/execution/detail/forward_like.hpp @@ -5,8 +5,12 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_FORWARD_LIKE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif // ---------------------------------------------------------------------------- // std::forward_like() doesn't work on some compilers, yet. This header diff --git a/include/beman/execution/detail/forwarding_query.hpp b/include/beman/execution/detail/forwarding_query.hpp index c71535b9..00084308 100644 --- a/include/beman/execution/detail/forwarding_query.hpp +++ b/include/beman/execution/detail/forwarding_query.hpp @@ -5,9 +5,13 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_FORWARDING_QUERY #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/fwd_env.hpp b/include/beman/execution/detail/fwd_env.hpp index b71d11ea..f01928ba 100644 --- a/include/beman/execution/detail/fwd_env.hpp +++ b/include/beman/execution/detail/fwd_env.hpp @@ -5,40 +5,43 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_FWD_ENV #include -#include +#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.forwarding_query +#else +#include +#endif -#include - -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -/*! + namespace beman::execution::detail { + /*! * \brief A helper class to create environments and taking forwarding_query into account * \headerfile beman/execution/execution.hpp * \internal */ -template //-dk:TODO detail export -class fwd_env { - private: - Env env; - - public: - explicit fwd_env(Env&& e) : env(::std::forward(e)) {} - - template - requires(!::beman::execution::forwarding_query(::std::remove_cvref_t())) - constexpr auto query(Query&& q, - Args&&... args) const = BEMAN_EXECUTION_DELETE("the used query is not forwardable"); - - template - requires(::beman::execution::forwarding_query(::std::remove_cvref_t())) && - requires(const Env& e, Query&& q, Args&&... args) { e.query(q, ::std::forward(args)...); } - constexpr auto query(Query&& q, Args&&... args) const - noexcept(noexcept(env.query(q, ::std::forward(args)...))) { - return env.query(q, ::std::forward(args)...); - } + template //-dk:TODO detail export + class fwd_env { private :Env env; + +public: +explicit fwd_env(Env&& e) : env(::std::forward(e)) {} + +template + requires(!::beman::execution::forwarding_query(::std::remove_cvref_t())) +constexpr auto query(Query&& q, Args&&... args) const = BEMAN_EXECUTION_DELETE("the used query is not forwardable"); + +template + requires(::beman::execution::forwarding_query(::std::remove_cvref_t())) && + requires(const Env& e, Query&& q, Args&&... args) { e.query(q, ::std::forward(args)...); } +constexpr auto query(Query&& q, Args&&... args) const noexcept(noexcept(env.query(q, ::std::forward(args)...))) { + return env.query(q, ::std::forward(args)...); +} }; template fwd_env(Env&&) -> fwd_env; diff --git a/include/beman/execution/detail/gather_signatures.hpp b/include/beman/execution/detail/gather_signatures.hpp index 70b8ff45..3c8cdaa8 100644 --- a/include/beman/execution/detail/gather_signatures.hpp +++ b/include/beman/execution/detail/gather_signatures.hpp @@ -5,16 +5,22 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GATHER_SIGNATURES #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.indirect_meta_apply import beman.execution.detail.meta_filter import beman.execution.detail.valid_completion_signatures +#else #include +#include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -concept always_true = true; + namespace beman::execution::detail { template concept always_true = true; template struct same_tag; diff --git a/include/beman/execution/detail/get_allocator.hpp b/include/beman/execution/detail/get_allocator.hpp index 0ae11ecf..3f41ab94 100644 --- a/include/beman/execution/detail/get_allocator.hpp +++ b/include/beman/execution/detail/get_allocator.hpp @@ -5,19 +5,25 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_ALLOCATOR #include -#include -#include +#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.forwarding_query import beman.execution.detail.simple_allocator +#else +#include +#include +#endif -#include - -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -struct get_allocator_t { - template - requires(not requires(Object&& object, const get_allocator_t& tag) { ::std::as_const(object).query(tag); }) + namespace beman::execution { struct get_allocator_t { template + requires(not requires(Object && object, const get_allocator_t& tag) { ::std::as_const(object).query(tag); +}) auto operator()(Object&&) const = BEMAN_EXECUTION_DELETE("the object requires a const query(get_allocator_t) overload"); template diff --git a/include/beman/execution/detail/get_awaiter.hpp b/include/beman/execution/detail/get_awaiter.hpp index 93678dfc..664893da 100644 --- a/include/beman/execution/detail/get_awaiter.hpp +++ b/include/beman/execution/detail/get_awaiter.hpp @@ -5,7 +5,11 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_AWAITER #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/get_completion_scheduler.hpp b/include/beman/execution/detail/get_completion_scheduler.hpp index 725e474f..1b6a9d35 100644 --- a/include/beman/execution/detail/get_completion_scheduler.hpp +++ b/include/beman/execution/detail/get_completion_scheduler.hpp @@ -5,6 +5,18 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_COMPLETION_SCHEDULER #include +#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.almost_scheduler import beman.execution.detail.completion_tag import beman.execution.detail.decayed_same_as import beman.execution.detail.forwarding_query import beman.execution.detail.get_env import beman.execution.detail.schedule import beman.execution.detail.set_error import beman.execution.detail.set_stopped import beman.execution.detail.set_value +#else +#include #include #include #include @@ -13,18 +25,11 @@ #include #include #include -#include -#include -#include -#include - -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -template -struct get_completion_scheduler_t; + namespace beman::execution { template struct get_completion_scheduler_t; template struct get_completion_scheduler_t : ::beman::execution::forwarding_query_t { diff --git a/include/beman/execution/detail/get_completion_signatures.hpp b/include/beman/execution/detail/get_completion_signatures.hpp index a172ec6e..e9277c71 100644 --- a/include/beman/execution/detail/get_completion_signatures.hpp +++ b/include/beman/execution/detail/get_completion_signatures.hpp @@ -5,29 +5,30 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_COMPLETION_SIGNATURES #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.await_result_type import beman.execution.detail.completion_signatures import beman.execution.detail.env_promise import beman.execution.detail.get_domain_late..- dk:TODO remove import beman.execution.detail.is_awaitable import beman.execution.detail.transform_sender..- dk:TODO remove +#else #include #include #include #include //-dk:TODO remove #include #include //-dk:TODO remove +#endif -#include -#include -#include -#include + // ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- - -namespace beman::execution { -struct get_completion_signatures_t { - private: - template - static auto get(Sender&& sender, Env&& env) noexcept { - auto new_sender{[](auto&& sndr, auto&& e) -> decltype(auto) { - auto domain{::beman::execution::detail::get_domain_late(sndr, e)}; - return ::beman::execution::transform_sender(domain, ::std::forward(sndr), ::std::forward(e)); - }}; + namespace beman::execution { struct get_completion_signatures_t { private : template static auto get(Sender && sender, Env && env) noexcept { auto new_sender{[](auto&& sndr, auto&& e) -> decltype(auto) { auto domain{::beman::execution::detail::get_domain_late(sndr, e) }; +return ::beman::execution::transform_sender(domain, ::std::forward(sndr), ::std::forward(e)); +}}; using sender_type = ::std::remove_cvref_t; using decayed_env = ::std::remove_cvref_t; diff --git a/include/beman/execution/detail/get_delegation_scheduler.hpp b/include/beman/execution/detail/get_delegation_scheduler.hpp index 61c21874..2e08e698 100644 --- a/include/beman/execution/detail/get_delegation_scheduler.hpp +++ b/include/beman/execution/detail/get_delegation_scheduler.hpp @@ -5,18 +5,23 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_DELEGATION_SCHEDULER #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.forwarding_query import beman.execution.detail.scheduler +#else #include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -struct get_delegation_scheduler_t { - template - requires requires(Env&& env, const get_delegation_scheduler_t& g) { - { ::std::as_const(env).query(g) } noexcept -> ::beman::execution::scheduler; - } + namespace beman::execution { struct get_delegation_scheduler_t { template + requires requires(Env && env, const get_delegation_scheduler_t& g) { { ::std::as_const(env).query(g) } noexcept->::beman::execution::scheduler; +} auto operator()(Env&& env) const noexcept { return ::std::as_const(env).query(*this); } diff --git a/include/beman/execution/detail/get_domain.hpp b/include/beman/execution/detail/get_domain.hpp index 932e1147..f051417b 100644 --- a/include/beman/execution/detail/get_domain.hpp +++ b/include/beman/execution/detail/get_domain.hpp @@ -5,19 +5,23 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_DOMAIN #include -#include -#include - #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.forwarding_query +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -struct get_domain_t { - template - requires(not requires(Object&& object, const get_domain_t& tag) { - ::std::forward(object).query(tag); - }) && (not requires(Object&& object, const get_domain_t& tag) { ::std::as_const(object).query(tag); }) + namespace beman::execution { struct get_domain_t { template + requires(not requires(Object && object, const get_domain_t& tag) { ::std::forward (object).query(tag); +}) && (not requires(Object&& object, const get_domain_t& tag) { ::std::as_const(object).query(tag); }) auto operator()(Object&&) const noexcept = BEMAN_EXECUTION_DELETE("object needs a query(get_domain_t) overload"); template requires(not requires(Object&& object, const get_domain_t& tag) { ::std::as_const(object).query(tag); }) diff --git a/include/beman/execution/detail/get_domain_early.hpp b/include/beman/execution/detail/get_domain_early.hpp index fe617bb3..97a9d3e8 100644 --- a/include/beman/execution/detail/get_domain_early.hpp +++ b/include/beman/execution/detail/get_domain_early.hpp @@ -5,17 +5,23 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_DOMAIN_EARLY #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.completion_domain import beman.execution.detail.default_domain import beman.execution.detail.get_domain import beman.execution.detail.get_env +#else #include #include #include #include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -constexpr auto get_domain_early(const Sender& sender) noexcept { - if constexpr (requires { ::beman::execution::get_domain(::beman::execution::get_env(sender)); }) + namespace beman::execution::detail { template constexpr auto get_domain_early(const Sender& sender) noexcept { if constexpr (requires { ::beman::execution::get_domain(::beman::execution::get_env(sender)); +}) return decltype(::beman::execution::get_domain(::beman::execution::get_env(sender))){}; else if constexpr (requires { ::beman::execution::detail::completion_domain(sender); }) return decltype(::beman::execution::detail::completion_domain(sender)){}; diff --git a/include/beman/execution/detail/get_domain_late.hpp b/include/beman/execution/detail/get_domain_late.hpp index a716f352..d7579e71 100644 --- a/include/beman/execution/detail/get_domain_late.hpp +++ b/include/beman/execution/detail/get_domain_late.hpp @@ -5,20 +5,26 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_DOMAIN_LATE #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.completion_domain import beman.execution.detail.default_domain import beman.execution.detail.get_domain import beman.execution.detail.get_env import beman.execution.detail.get_scheduler import beman.execution.detail.sender_decompose import beman.execution.detail.tag_of_t +#else #include -#include +#include #include +#include #include #include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -concept not_void = !::std::same_as; + namespace beman::execution::detail { template concept not_void = ! ::std::same_as ; template struct get_domain_late_helper { diff --git a/include/beman/execution/detail/get_env.hpp b/include/beman/execution/detail/get_env.hpp index ab030f53..e76a5783 100644 --- a/include/beman/execution/detail/get_env.hpp +++ b/include/beman/execution/detail/get_env.hpp @@ -5,17 +5,24 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_ENV #include -#include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.env import beman.execution.detail.queryable +#else +#include +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -struct get_env_t { - template - requires(not requires(::std::add_const_t<::std::remove_cvref_t>& object) { object.get_env(); } || + namespace beman::execution { struct get_env_t { template + requires(not requires(::std::add_const_t <::std::remove_cvref_t> & object) { object.get_env(); +} || ::beman::execution::detail::queryable< std::remove_cvref_t&>().get_env())>>) auto operator()(Object&& object) const noexcept -> decltype(auto) { @@ -28,7 +35,7 @@ struct get_env_t { } else { return ::beman::execution::env<>{}; } - } +} }; inline constexpr get_env_t get_env{}; diff --git a/include/beman/execution/detail/get_scheduler.hpp b/include/beman/execution/detail/get_scheduler.hpp index 3ab03070..f8338bac 100644 --- a/include/beman/execution/detail/get_scheduler.hpp +++ b/include/beman/execution/detail/get_scheduler.hpp @@ -5,15 +5,22 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_SCHEDULER #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.forwarding_query +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -struct get_scheduler_t : ::beman::execution::forwarding_query_t { - template - requires requires(const get_scheduler_t& self, Env&& env) { ::std::as_const(env).query(self); } + namespace beman::execution { struct get_scheduler_t: ::beman::execution::forwarding_query_t { template + requires requires(const get_scheduler_t& self, Env && env) { ::std::as_const(env).query(self); +} auto operator()(Env&& env) const noexcept { static_assert(noexcept(::std::as_const(env).query(*this))); //-dk:TODO mandate that the result is a scheduler diff --git a/include/beman/execution/detail/get_stop_token.hpp b/include/beman/execution/detail/get_stop_token.hpp index b81bc5ea..374259c6 100644 --- a/include/beman/execution/detail/get_stop_token.hpp +++ b/include/beman/execution/detail/get_stop_token.hpp @@ -5,17 +5,23 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_STOP_TOKEN #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.forwarding_query import beman.execution.detail.never_stop_token import beman.execution.detail.stoppable_token +#else #include #include #include -#include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -concept decayed_stoppable_token = ::beman::execution::stoppable_token<::std::decay_t>; + namespace beman::execution::detail { template concept decayed_stoppable_token = ::beman::execution::stoppable_token <::std::decay_t>; } namespace beman::execution { struct get_stop_token_t { diff --git a/include/beman/execution/detail/has_as_awaitable.hpp b/include/beman/execution/detail/has_as_awaitable.hpp index 447bdaca..30434a9a 100644 --- a/include/beman/execution/detail/has_as_awaitable.hpp +++ b/include/beman/execution/detail/has_as_awaitable.hpp @@ -5,15 +5,20 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_HAS_AS_AWAITABLE #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.is_awaitable +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -concept has_as_awaitable = requires(T&& obj, Promise& promise) { - { ::std::forward(obj).as_awaitable(promise) } -> ::beman::execution::detail::is_awaitable; + namespace beman::execution::detail { template concept has_as_awaitable = requires(T && obj, Promise & promise) { { ::std::forward (obj).as_awaitable(promise) }->::beman::execution::detail::is_awaitable ; }; } // namespace beman::execution::detail diff --git a/include/beman/execution/detail/has_completions.hpp b/include/beman/execution/detail/has_completions.hpp index 24d747ab..837f7d52 100644 --- a/include/beman/execution/detail/has_completions.hpp +++ b/include/beman/execution/detail/has_completions.hpp @@ -5,16 +5,20 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_HAS_COMPLETIONS #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.completion_signatures import beman.execution.detail.valid_completion_for +#else #include +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -concept has_completions = requires(Completions* completions) { - []<::beman::execution::detail::valid_completion_for... Signatures>( - ::beman::execution::completion_signatures*) {}(completions); + namespace beman::execution::detail { template concept has_completions = requires(Completions * completions) { [] <::beman::execution::detail::valid_completion_for...Signatures>(::beman::execution::completion_signatures *) {}(completions); }; } // namespace beman::execution::detail diff --git a/include/beman/execution/detail/immovable.hpp b/include/beman/execution/detail/immovable.hpp index 138a7348..42e62fe0 100644 --- a/include/beman/execution/detail/immovable.hpp +++ b/include/beman/execution/detail/immovable.hpp @@ -5,6 +5,10 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_IMMOVABLE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/impls_for.hpp b/include/beman/execution/detail/impls_for.hpp index 3da8cdde..63919c57 100644 --- a/include/beman/execution/detail/impls_for.hpp +++ b/include/beman/execution/detail/impls_for.hpp @@ -5,13 +5,19 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_IMPLS_FOR #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.default_impls +#else #include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -struct impls_for : ::beman::execution::detail::default_impls {}; + namespace beman::execution::detail { template struct impls_for: ::beman::execution::detail::default_impls {}; } // namespace beman::execution::detail // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/indices_for.hpp b/include/beman/execution/detail/indices_for.hpp index 8c1a12b6..499d34b4 100644 --- a/include/beman/execution/detail/indices_for.hpp +++ b/include/beman/execution/detail/indices_for.hpp @@ -5,7 +5,11 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_INDICES_FOR #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/indirect_meta_apply.hpp b/include/beman/execution/detail/indirect_meta_apply.hpp index 92be6108..fc624247 100644 --- a/include/beman/execution/detail/indirect_meta_apply.hpp +++ b/include/beman/execution/detail/indirect_meta_apply.hpp @@ -5,6 +5,10 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_INDIRECT_META_APPLY #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/inplace_stop_source.hpp b/include/beman/execution/detail/inplace_stop_source.hpp index f010dd53..b6fbb88d 100644 --- a/include/beman/execution/detail/inplace_stop_source.hpp +++ b/include/beman/execution/detail/inplace_stop_source.hpp @@ -5,17 +5,24 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_INPLACE_STOP_SOURCE #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include #include #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.immovable +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution { -class inplace_stop_token; + namespace beman::execution { class inplace_stop_token; class inplace_stop_source; template class inplace_stop_callback; diff --git a/include/beman/execution/detail/into_variant.hpp b/include/beman/execution/detail/into_variant.hpp index b494a9cb..431df747 100644 --- a/include/beman/execution/detail/into_variant.hpp +++ b/include/beman/execution/detail/into_variant.hpp @@ -5,10 +5,21 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_INTO_VARIANT #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.child_type import beman.execution.detail.completion_signatures_for import beman.execution.detail.decayed_tuple import beman.execution.detail.default_impls import beman.execution.detail.env_of_t import beman.execution.detail.error_types_of_t import beman.execution.detail.get_domain_early import beman.execution.detail.impls_for import beman.execution.detail.make_sender import beman.execution.detail.meta_combine import beman.execution.detail.sender import beman.execution.detail.sends_stopped import beman.execution.detail.set_error import beman.execution.detail.set_value import beman.execution.detail.transform_sender import beman.execution.detail.value_types_of_t +#else #include #include -#include #include +#include #include #include #include @@ -21,26 +32,18 @@ #include #include #include +#endif -#include -#include -#include -#include - -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -struct into_variant_t { - template <::beman::execution::sender Sender> - auto operator()(Sender&& sender) const { - auto domain{::beman::execution::detail::get_domain_early(sender)}; - (void)domain; - return ::beman::execution::detail::make_sender(*this, {}, ::std::forward(sender)); - // return ::beman::execution::transform_sender( - // ::std::move(domain), - // ::beman::execution::detail::make_sender(*this, {}, ::std::forward(sender)) - //); - } + namespace beman::execution::detail { struct into_variant_t { template <::beman::execution::sender Sender> auto operator()(Sender && sender) const { auto domain{::beman::execution::detail::get_domain_early(sender) }; +(void)domain; +return ::beman::execution::detail::make_sender(*this, {}, ::std::forward(sender)); +// return ::beman::execution::transform_sender( +// ::std::move(domain), +// ::beman::execution::detail::make_sender(*this, {}, ::std::forward(sender)) +//); +} }; template <> diff --git a/include/beman/execution/detail/intrusive_stack.hpp b/include/beman/execution/detail/intrusive_stack.hpp index 43a09a11..276a4d6f 100644 --- a/include/beman/execution/detail/intrusive_stack.hpp +++ b/include/beman/execution/detail/intrusive_stack.hpp @@ -5,8 +5,12 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_INTRUSIVE_QUEUE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif namespace beman::execution::detail { diff --git a/include/beman/execution/detail/is_awaitable.hpp b/include/beman/execution/detail/is_awaitable.hpp index 5d13b0d1..50563ac3 100644 --- a/include/beman/execution/detail/is_awaitable.hpp +++ b/include/beman/execution/detail/is_awaitable.hpp @@ -5,18 +5,21 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_IS_AWAITABLE #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.get_awaiter import beman.execution.detail.is_awaiter +#else #include #include -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -concept is_awaitable = requires(Promise& promise) { - { - ::beman::execution::detail::get_awaiter(::std::declval(), promise) - } -> ::beman::execution::detail::is_awaiter; + namespace beman::execution::detail { template concept is_awaitable = requires(Promise & promise) { { ::beman::execution::detail::get_awaiter(::std::declval (), promise) }->::beman::execution::detail::is_awaiter ; }; } // namespace beman::execution::detail diff --git a/include/beman/execution/detail/is_awaiter.hpp b/include/beman/execution/detail/is_awaiter.hpp index e1efcd83..a48672c5 100644 --- a/include/beman/execution/detail/is_awaiter.hpp +++ b/include/beman/execution/detail/is_awaiter.hpp @@ -5,17 +5,22 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_IS_AWAITER #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.await_suspend_result +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -template -concept is_awaiter = requires(Awaiter& awaiter, ::std::coroutine_handle handle) { - awaiter.await_ready() ? 1 : 0; - { awaiter.await_suspend(handle) } -> ::beman::execution::detail::await_suspend_result; - awaiter.await_resume(); + namespace beman::execution::detail { template concept is_awaiter = requires(Awaiter & awaiter, ::std::coroutine_handle handle) { awaiter.await_ready() ? 1 : 0; +{ awaiter.await_suspend(handle) } -> ::beman::execution::detail::await_suspend_result; +awaiter.await_resume(); }; } // namespace beman::execution::detail diff --git a/include/beman/execution/detail/join_env.hpp b/include/beman/execution/detail/join_env.hpp index a582d08a..cf72f250 100644 --- a/include/beman/execution/detail/join_env.hpp +++ b/include/beman/execution/detail/join_env.hpp @@ -5,8 +5,12 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_JOIN_ENV #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/just.hpp b/include/beman/execution/detail/just.hpp index 9de59bb5..2f130744 100644 --- a/include/beman/execution/detail/just.hpp +++ b/include/beman/execution/detail/just.hpp @@ -5,27 +5,32 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_JUST #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.completion_signatures_for import beman.execution.detail.default_impls import beman.execution.detail.impls_for import beman.execution.detail.make_sender import beman.execution.detail.movable_value import beman.execution.detail.product_type import beman.execution.detail.set_error import beman.execution.detail.set_stopped import beman.execution.detail.set_value +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif // ---------------------------------------------------------------------------- #include -namespace beman::execution::detail { -template -concept just_size = (!::std::same_as or 1u == sizeof...(T)) && - (!::std::same_as or 0u == sizeof...(T)); + namespace beman::execution::detail { template concept just_size =(! ::std::same_as or 1u == sizeof...(T)) &&(! ::std::same_as or 0u == sizeof...(T)); template struct just_t { template diff --git a/include/beman/execution/detail/let.hpp b/include/beman/execution/detail/let.hpp index 5d54d54c..4d360e89 100644 --- a/include/beman/execution/detail/let.hpp +++ b/include/beman/execution/detail/let.hpp @@ -5,53 +5,56 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_LET #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#include +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.allocator_aware_move import beman.execution.detail.completion_signatures_for import beman.execution.detail.completion_signatures_of_t import beman.execution.detail.connect import beman.execution.detail.decayed_tuple import beman.execution.detail.default_impls import beman.execution.detail.emplace_from import beman.execution.detail.env import beman.execution.detail.env_of_t import beman.execution.detail.forward_like import beman.execution.detail.fwd_env import beman.execution.detail.get_domain_early import beman.execution.detail.impls_for import beman.execution.detail.join_env import beman.execution.detail.make_env import beman.execution.detail.make_sender import beman.execution.detail.meta_combine import beman.execution.detail.meta_filter import beman.execution.detail.meta_prepend import beman.execution.detail.meta_to import beman.execution.detail.meta_transform import beman.execution.detail.meta_unique import beman.execution.detail.movable_value import beman.execution.detail.sched_env import beman.execution.detail.sender import beman.execution.detail.sender_adaptor import beman.execution.detail.set_error import beman.execution.detail.set_stopped import beman.execution.detail.set_value import beman.execution.detail.transform_sender import beman.execution.detail.type_list +#else #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include #include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include #include -#include -#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#endif // ---------------------------------------------------------------------------- #include -namespace beman::execution::detail { -template -struct let_t { - template <::beman::execution::detail::movable_value Fun> - auto operator()(Fun&& fun) const { - return ::beman::execution::detail::sender_adaptor{*this, ::std::forward(fun)}; + namespace beman::execution::detail { template struct let_t { template <::beman::execution::detail::movable_value Fun> auto operator()(Fun && fun) const { return ::beman::execution::detail::sender_adaptor{* this, ::std::forward (fun) }; } template <::beman::execution::sender Sender, ::beman::execution::detail::movable_value Fun> auto operator()(Sender&& sender, Fun&& fun) const { diff --git a/include/beman/execution/detail/make_env.hpp b/include/beman/execution/detail/make_env.hpp index b93fdd3c..837eea71 100644 --- a/include/beman/execution/detail/make_env.hpp +++ b/include/beman/execution/detail/make_env.hpp @@ -5,8 +5,12 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_MAKE_ENV #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/make_sender.hpp b/include/beman/execution/detail/make_sender.hpp index 4671ce65..19798654 100644 --- a/include/beman/execution/detail/make_sender.hpp +++ b/include/beman/execution/detail/make_sender.hpp @@ -5,18 +5,23 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_MAKE_SENDER #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else +#include +#include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.basic_sender import beman.execution.detail.movable_value import beman.execution.detail.sender +#else #include #include #include -#include -#include - -#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail { -struct make_sender_empty {}; + namespace beman::execution::detail { struct make_sender_empty {}; template requires ::std::semiregular && ::beman::execution::detail::movable_value && diff --git a/include/beman/execution/detail/matching_sig.hpp b/include/beman/execution/detail/matching_sig.hpp index f137bbbc..7d802168 100644 --- a/include/beman/execution/detail/matching_sig.hpp +++ b/include/beman/execution/detail/matching_sig.hpp @@ -5,7 +5,11 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_MATCHING_SIG #include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/meta_combine.hpp b/include/beman/execution/detail/meta_combine.hpp index e7b9c85f..0c155427 100644 --- a/include/beman/execution/detail/meta_combine.hpp +++ b/include/beman/execution/detail/meta_combine.hpp @@ -5,14 +5,20 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_META_COMBINE #include -#include +#ifdef BEMAN_HAS_IMPORT_STD +import std; +#else #include +#endif +#ifdef BEMAN_HAS_MODULES +import beman.execution.detail.type_list +#else +#include +#endif -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -namespace beman::execution::detail::meta::detail { -template -struct combine; + namespace beman::execution::detail::meta::detail { template struct combine; template