From 3462a499e35026b720fa3a16ad67121658dde3b8 Mon Sep 17 00:00:00 2001 From: Cra3z <3324654761@qq.com> Date: Wed, 29 Apr 2026 22:00:30 +0800 Subject: [PATCH 1/2] Implement P4154 --- docs/code/tst-basic-timer.cpp | 2 +- docs/code/tst-repeat_effect_until.hpp | 6 +-- docs/code/tst-sync_wait.hpp | 2 +- docs/code/tst-timer.hpp | 12 ++--- docs/dependency.txt | 32 ++++++------ docs/overview.md | 30 +++++------ examples/inspect.cpp | 4 +- examples/intro-5-consumer.cpp | 6 +-- examples/intro-timer.hpp | 18 +++---- examples/just_stopped.cpp | 2 +- examples/sender-demo.cpp | 6 +-- examples/stackoverflow.cpp | 4 +- examples/stopping.cpp | 6 +-- examples/when_all-cancel.cpp | 12 ++--- .../execution/detail/almost_scheduler.hpp | 6 +-- .../beman/execution/detail/as_awaitable.hpp | 6 +-- .../execution/detail/basic_operation.hpp | 2 +- .../beman/execution/detail/basic_receiver.hpp | 2 +- .../beman/execution/detail/basic_sender.hpp | 2 +- .../execution/detail/inline_scheduler.hpp | 8 +-- include/beman/execution/detail/let.hpp | 2 +- include/beman/execution/detail/on.hpp | 2 +- .../execution/detail/operation_state.hpp | 6 ++- .../execution/detail/operation_state_task.hpp | 2 +- include/beman/execution/detail/receiver.hpp | 6 ++- include/beman/execution/detail/run_loop.hpp | 8 +-- .../beman/execution/detail/schedule_from.hpp | 10 ++-- .../{scheduler_t.hpp => scheduler_tag.hpp} | 12 +++-- .../beman/execution/detail/scope_token.hpp | 2 +- include/beman/execution/detail/sender.hpp | 6 ++- .../execution/detail/sender_awaitable.hpp | 2 +- include/beman/execution/detail/spawn.hpp | 6 +-- .../beman/execution/detail/spawn_future.hpp | 12 ++--- include/beman/execution/detail/split.hpp | 2 +- include/beman/execution/detail/stop_when.hpp | 6 +-- .../beman/execution/detail/store_receiver.hpp | 6 +-- include/beman/execution/detail/sync_wait.hpp | 2 +- include/beman/execution26/execution.hpp | 8 +-- src/beman/execution/CMakeLists.txt | 4 +- src/beman/execution/execution.cppm | 2 +- src/beman/execution/operation_state.cppm | 1 + src/beman/execution/receiver.cppm | 1 + src/beman/execution/scheduler_t.cppm | 11 ---- src/beman/execution/scheduler_tag.cppm | 12 +++++ src/beman/execution/sender.cppm | 1 + tests/beman/execution/exec-affine-on.test.cpp | 8 +-- tests/beman/execution/exec-connect.test.cpp | 18 +++---- .../execution/exec-continues-on.test.cpp | 10 ++-- .../execution/exec-domain-default.test.cpp | 4 +- .../execution/exec-get-compl-sched.test.cpp | 4 +- .../exec-get-delegation-scheduler.test.cpp | 4 +- .../execution/exec-getcomplsigs.test.cpp | 8 +-- .../execution/exec-into-variant.test.cpp | 10 ++-- tests/beman/execution/exec-just.test.cpp | 8 +-- tests/beman/execution/exec-let.test.cpp | 8 +-- tests/beman/execution/exec-on.test.cpp | 2 +- tests/beman/execution/exec-opstate.test.cpp | 14 +++--- tests/beman/execution/exec-read-env.test.cpp | 2 +- .../execution/exec-recv-concepts.test.cpp | 8 +-- tests/beman/execution/exec-recv.test.cpp | 12 ++--- .../execution/exec-run-loop-types.test.cpp | 4 +- tests/beman/execution/exec-sched.test.cpp | 14 +++--- .../execution/exec-schedule-from.test.cpp | 10 ++-- tests/beman/execution/exec-schedule.test.cpp | 2 +- .../execution/exec-scope-concepts.test.cpp | 6 +-- .../execution/exec-scope-counting.test.cpp | 2 +- .../exec-scope-simple-counting.test.cpp | 2 +- .../exec-sender-adaptor-closure.test.cpp | 4 +- tests/beman/execution/exec-snd-apply.test.cpp | 2 +- .../execution/exec-snd-concepts.test.cpp | 28 +++++------ tests/beman/execution/exec-snd-expos.test.cpp | 50 +++++++++---------- .../execution/exec-snd-transform.test.cpp | 4 +- .../execution/exec-spawn-future.test.cpp | 8 +-- tests/beman/execution/exec-spawn.test.cpp | 4 +- tests/beman/execution/exec-split.test.cpp | 6 +-- tests/beman/execution/exec-starts-on.test.cpp | 10 ++-- tests/beman/execution/exec-stop-when.test.cpp | 6 +-- .../exec-sync-wait-with-variant.test.cpp | 4 +- tests/beman/execution/exec-sync-wait.test.cpp | 14 +++--- tests/beman/execution/exec-then.test.cpp | 6 +-- .../execution/exec-utils-cmplsigs.test.cpp | 2 +- tests/beman/execution/exec-when-all.test.cpp | 16 +++--- .../beman/execution/execution-module.test.cpp | 8 +-- tests/beman/execution/execution-syn.test.cpp | 30 +++++------ .../include/test/completion_test.hpp | 6 +-- .../include/test/optional_sender.hpp | 4 +- .../execution/include/test/thread_pool.hpp | 6 +-- tests/beman/execution/notify.test.cpp | 2 +- 88 files changed, 346 insertions(+), 334 deletions(-) rename include/beman/execution/detail/{scheduler_t.hpp => scheduler_tag.hpp} (56%) delete mode 100644 src/beman/execution/scheduler_t.cppm create mode 100644 src/beman/execution/scheduler_tag.cppm diff --git a/docs/code/tst-basic-timer.cpp b/docs/code/tst-basic-timer.cpp index 3779e482..7244945b 100644 --- a/docs/code/tst-basic-timer.cpp +++ b/docs/code/tst-basic-timer.cpp @@ -10,7 +10,7 @@ namespace ex = beman::execution; // ---------------------------------------------------------------------------- struct receiver { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; auto set_value() && noexcept { std::cout << "timer done\n"; } auto set_error(const std::exception_ptr&) && noexcept { std::cout << "timer error\n"; } diff --git a/docs/code/tst-repeat_effect_until.hpp b/docs/code/tst-repeat_effect_until.hpp index bfb6e89f..950584d4 100644 --- a/docs/code/tst-repeat_effect_until.hpp +++ b/docs/code/tst-repeat_effect_until.hpp @@ -24,15 +24,15 @@ struct connector { inline constexpr struct repeat_effect_unilt_t { template struct sender { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; using completion_signatures = ex::completion_signatures; template struct state { - using operation_state_concept = ex::operation_state_t; + using operation_state_concept = ex::operation_state_tag; struct own_receiver { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; state* s; auto set_value() && noexcept -> void { static_assert(ex::receiver); diff --git a/docs/code/tst-sync_wait.hpp b/docs/code/tst-sync_wait.hpp index c7ea2225..341a4fef 100644 --- a/docs/code/tst-sync_wait.hpp +++ b/docs/code/tst-sync_wait.hpp @@ -32,7 +32,7 @@ struct add_set_value { struct add_signature, false> { using type = tst::ex::completion_signatures; }; - using sender_concept = tst::ex::sender_t; + using sender_concept = tst::ex::sender_tag; template constexpr auto get_completion_signatures(const Env& e) noexcept { using orig = decltype(tst::ex::get_completion_signatures(std::declval(), e)); diff --git a/docs/code/tst-timer.hpp b/docs/code/tst-timer.hpp index c1ccb5e7..36afd60c 100644 --- a/docs/code/tst-timer.hpp +++ b/docs/code/tst-timer.hpp @@ -29,14 +29,14 @@ class tst::timer { public: class when_done_sender { public: - using sender_concept = tst::ex::sender_t; + using sender_concept = tst::ex::sender_tag; using completion_signatures = tst::ex::completion_signatures; template struct state { - using operation_state_concept = tst::ex::operation_state_t; - using scheduler_t = decltype(ex::get_scheduler(ex::get_env(std::declval()))); + using operation_state_concept = tst::ex::operation_state_tag; + using scheduler_tag = decltype(ex::get_scheduler(ex::get_env(std::declval()))); struct execute { state* s{}; auto operator()() noexcept -> void { this->s->await_one(); } @@ -46,7 +46,7 @@ class tst::timer { auto operator()() noexcept -> bool { return this->s->object->queue.empty(); } }; using inner_sender = decltype(tst::repeat_effect_until( - ex::schedule(std::declval()) | ex::then(execute()), pred())); + ex::schedule(std::declval()) | ex::then(execute()), pred())); tst::timer* object; tst::connector inner_op; @@ -78,11 +78,11 @@ class tst::timer { virtual auto complete() noexcept -> void = 0; }; struct resume_after_sender { - using sender_concept = tst::ex::sender_t; + using sender_concept = tst::ex::sender_tag; using completion_signatures = tst::ex::completion_signatures; template struct state : base { - using operation_state_concept = ex::operation_state_t; + using operation_state_concept = ex::operation_state_tag; tst::timer* object; std::chrono::milliseconds duration; std::remove_cvref_t receiver; diff --git a/docs/dependency.txt b/docs/dependency.txt index 3af8d059..93393744 100644 --- a/docs/dependency.txt +++ b/docs/dependency.txt @@ -3,7 +3,7 @@ as_awaitable is_awaitable await_result_type get_awaiter awaitable_receiver forwarding_query awaitable_receiver get_env -awaitable_receiver receiver_t +awaitable_receiver receiver_tag awaitable_receiver set_error awaitable_receiver set_stopped awaitable_receiver set_value @@ -15,7 +15,7 @@ basic_operation connect_all_result basic_operation impls_for basic_operation indices_for basic_operation inner_ops -basic_operation operation_state_t +basic_operation operation_state_tag basic_operation state_type basic_operation tag_of_t basic_operation valid_specialization @@ -23,7 +23,7 @@ basic_receiver basic_state basic_receiver callable basic_receiver env_type basic_receiver impls_for -basic_receiver receiver_t +basic_receiver receiver_tag basic_receiver set_error basic_receiver set_stopped basic_receiver set_value @@ -35,7 +35,7 @@ basic_sender completion_signatures_for basic_sender decays_to basic_sender impls_for basic_sender product_type -basic_sender sender_t +basic_sender sender_tag basic_state impls_for basic_state state_type basic_state tag_of_t @@ -182,7 +182,7 @@ into_variant value_types_of_t is_awaitable get_awaiter is_awaitable is_awaiter is_awaiter await_suspend_result -is_sender sender_t +is_sender sender_tag join_env queryable just decayed_typeof just default_impls @@ -212,7 +212,7 @@ let_error join_env let_error make_env let_error make_sender let_error movable_value -let_error receiver_t +let_error receiver_tag let_error sched_env let_error sender_adaptor_closure let_error sender_for @@ -237,7 +237,7 @@ let_stopped join_env let_stopped make_env let_stopped make_sender let_stopped movable_value -let_stopped receiver_t +let_stopped receiver_tag let_stopped sched_env let_stopped sender_adaptor_closure let_stopped sender_for @@ -262,7 +262,7 @@ let_value join_env let_value make_env let_value make_sender let_value movable_value -let_value receiver_t +let_value receiver_tag let_value sched_env let_value sender_adaptor_closure let_value sender_for @@ -287,15 +287,15 @@ on sender on sender_adaptor_closure on sender_for on sender_in -on sender_t +on sender_tag on set_value on transform_sender on write_env on_stop_request inplace_stop_source -operation_state operation_state_t +operation_state operation_state_tag operation_state start operation_state_task connect_awaitable_promise -operation_state_task operation_state_t +operation_state_task operation_state_tag read_env decayed_typeof read_env default_impls read_env get_env @@ -305,7 +305,7 @@ read_env query read_env try_set_value receiver get_env receiver queryable -receiver receiver_t +receiver receiver_tag receiver_of has_completions run_loop connect run_loop get_completion_scheduler @@ -338,7 +338,7 @@ schedule_from impls_for schedule_from join_env schedule_from make_sender schedule_from query_with_default -schedule_from receiver_t +schedule_from receiver_tag schedule_from sched_attrs schedule_from schedule schedule_from schedule_result_t @@ -352,7 +352,7 @@ scheduler get_env scheduler queryable scheduler schedule scheduler schedule_result_t -scheduler scheduler_t +scheduler scheduler_tag scheduler sender_in scheduler set_value_t sender enable_sender @@ -394,7 +394,7 @@ split get_domain_early split get_stop_token split inplace_stop_token split make_sender -split receiver_t +split receiver_tag split sender_in split set_error split set_stopped @@ -441,7 +441,7 @@ sync_wait get_delegation_scheduler sync_wait get_domain_early sync_wait get_scheduler sync_wait into_variant -sync_wait receiver_t +sync_wait receiver_tag sync_wait run_loop sync_wait sender_in sync_wait sender_to diff --git a/docs/overview.md b/docs/overview.md index 2fd3606a..6b093f6b 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -32,7 +32,7 @@ Operation states represent asynchronous operations ready to be _State_: -- The type `operation_state_concept` is an alias for `operation_state_t` or a type derived thereof. +- The type `operation_state_concept` is an alias for `operation_state_tag` or a type derived thereof. - state.start() & noexcept
@@ -44,7 +44,7 @@ This example shows a simple operation state object which immediately completes s template struct example_state { - using operation_state_concept = std::execution::operation_state_t; + using operation_state_concept = std::execution::operation_state_tag; std::remove_cvref_t receiver; auto start() & noexcept { @@ -67,7 +67,7 @@ Users don’t interact with receivers explicitly except when implementing new se Required members for _Receiver_: -- The type `receiver_concept` is an alias for `receiver_t` or a type derived thereof`. +- The type `receiver_concept` is an alias for `receiver_tag` or a type derived thereof`. - Rvalues of type _Receiver_ are movable. - Lvalues of type _Receiver_ are copyable. - std::execution::get_env(_receiver_) returns an object. By default this operation returns std::execution::env<>. @@ -88,7 +88,7 @@ The example receiver prints the name of each the received struct example_receiver { - using receiver_concept = std::execution::receiver_t; + using receiver_concept = std::execution::receiver_tag; std::remove_cvref_t nested; auto get_env() const noexcept { @@ -128,7 +128,7 @@ The example defines a simple receiver a ```c++ struct example_receiver { - using receiver_concept = std::execution::receiver_t; + using receiver_concept = std::execution::receiver_tag; auto set_value(int) && noexcept ->void {} auto set_stopped() && noexcept ->void {} @@ -161,7 +161,7 @@ static_assert(not std::execution::receiver_ofschedule operation yielding a sender with a value completion signal without parameters. The completion is on the respective execution context. Requirements for _Scheduler_: -- The type _Scheduler_::scheduler_concept is an alias for `scheduler_t` or a type derived thereof. +- The type _Scheduler_::scheduler_concept is an alias for `scheduler_tag` or a type derived thereof. - schedule(_scheduler_) -> sender - The value completion scheduler of the sender’s environment is the _scheduler_: _scheduler_ == std::execution::get_completion_scheduler<std::execution::set_value_t>( @@ -176,7 +176,7 @@ Requirements for _Scheduler_: Senders represent asynchronous work. They may get composed from multiple senders to model a workflow. Senders can’t be run directly. Instead, they are passed to a which connects the sender to a receiver to produce an operation_state which may get started. When using senders to represent work the inner workings shouldn’t matter. They do become relevant when creating sender algorithms. Requirements for _Sender_: -- The type _Sender_::sender_concept is an alias for `sender_t` or a type derived thereof or _Sender_ is a suitable _awaitable_. +- The type _Sender_::sender_concept is an alias for `sender_tag` or a type derived thereof or _Sender_ is a suitable _awaitable_. - std::execution::get_env(_sender_) is valid. By default this operation returns std::execution::env<>. - Rvalues of type _Sender_ can be moved. - Lvalues of type _Sender_ can be copied. @@ -197,7 +197,7 @@ struct example_sender template struct state { - using operation_state_concept = std::execution::operation_state_t; + using operation_state_concept = std::execution::operation_state_tag; std::remove_cvref_t receiver; int value; auto start() & noexcept { @@ -207,7 +207,7 @@ struct example_sender ); } }; - using sender_concept = std::execution::sender_t; + using sender_concept = std::execution::sender_tag; using completion_signatures = std::execution::completion_signatures< std::execution::set_value_t(int) >; @@ -296,7 +296,7 @@ struct example_state this->state.stop(); } }; - using operation_state_concept = std::execution::operation_state_t; + using operation_state_concept = std::execution::operation_state_tag; using env = std::execution::env_of_t; using token = std::execution::stop_callback_of_t; using callback = std::execution::stop_callback_of_t; @@ -493,7 +493,7 @@ To determine the result the sender is first transformed usin When a sender doesn’t need to compute the completion signatures based on an environment it is easiest to use a the type alias, e.g.: ```c++ struct sender { - using sender_concept = std::execution::sender_t; + using sender_concept = std::execution::sender_tag; using completion_signatures = std::completion_signatures< std::execution::set_value_t(int), std::execution::set_error_t(std::error_code), @@ -727,13 +727,13 @@ The expression into_variant(sender) creates a sender which t - `env_of_t` - `error_types_of_t` - `fwd_env` -- `operation_state_t` -- `receiver_t` +- `operation_state_tag` +- `receiver_tag` - `run_loop` -- `scheduler_t` +- `scheduler_tag` - `schedule_result_t` - `sender_adaptor_closure` -- `sender_t` +- `sender_tag` - `stop_token_of_t` - `tag_of_t` - `transform_sender` diff --git a/examples/inspect.cpp b/examples/inspect.cpp index 272e2796..924a61a4 100644 --- a/examples/inspect.cpp +++ b/examples/inspect.cpp @@ -137,7 +137,7 @@ namespace { struct logger_t { template struct state { - using operation_state_concept = ex::operation_state_t; + using operation_state_concept = ex::operation_state_tag; using inner_t = decltype(ex::connect(std::declval(), std::declval())); inner_t inner; @@ -154,7 +154,7 @@ struct logger_t { template struct sender { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; Sndr sndr; Log log; diff --git a/examples/intro-5-consumer.cpp b/examples/intro-5-consumer.cpp index be15e862..c85802e4 100644 --- a/examples/intro-5-consumer.cpp +++ b/examples/intro-5-consumer.cpp @@ -63,7 +63,7 @@ enum class failure : std::uint8_t { fail_one }; struct expected_to_channel_t { template struct own_receiver { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; Receiver* receiver; template auto set_value(tst::expected&& exp) noexcept -> void { @@ -88,7 +88,7 @@ struct expected_to_channel_t { }; template struct state { - using operation_state_concept = ex::operation_state_t; + using operation_state_concept = ex::operation_state_tag; using child_state_t = decltype(ex::connect(std::declval(), std::declval>())); Receiver parent_receiver; child_state_t child_state; @@ -105,7 +105,7 @@ struct expected_to_channel_t { template struct sender { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; // value_types_of -> set_value_t(std::expected) // -> completion_signatures // -> + error_type_of diff --git a/examples/intro-timer.hpp b/examples/intro-timer.hpp index 09c68ca8..1413371c 100644 --- a/examples/intro-timer.hpp +++ b/examples/intro-timer.hpp @@ -20,7 +20,7 @@ struct intro::timer { }; template struct state : state_base { - using operation_state_concept = ex::operation_state_t; + using operation_state_concept = ex::operation_state_tag; timer* self; std::remove_cvref_t receiver; std::chrono::milliseconds ms; @@ -32,7 +32,7 @@ struct intro::timer { void complete() override { ex::set_value(std::move(receiver)); } }; struct sender { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; using completion_signatures = ex::completion_signatures; template static consteval auto get_completion_signatures() noexcept -> completion_signatures { @@ -68,19 +68,19 @@ struct intro::timer { template struct run_state { struct recv { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; run_state* self; auto set_value(auto&&...) noexcept -> void { this->self->run_one(); } auto set_error(auto&&) noexcept -> void { this->self->run_one(); } auto set_stopped() noexcept -> void { this->self->run_one(); } }; - using operation_state_concept = ex::operation_state_t; - using scheduler_t = decltype(ex::get_delegation_scheduler(ex::get_env(std::declval()))); + using operation_state_concept = ex::operation_state_tag; + using scheduler_tag = decltype(ex::get_delegation_scheduler(ex::get_env(std::declval()))); static_assert(ex::receiver); - static_assert(ex::scheduler); - static_assert(ex::sender()))>); - using state_t = decltype(ex::connect(ex::schedule(std::declval()), std::declval())); + static_assert(ex::scheduler); + static_assert(ex::sender()))>); + using state_t = decltype(ex::connect(ex::schedule(std::declval()), std::declval())); struct state_ctor { state_t state; template @@ -106,7 +106,7 @@ struct intro::timer { auto start() & noexcept -> void { this->schedule_one(); } }; struct run_sender { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; using completion_signatures = ex::completion_signatures; template static consteval auto get_completion_signatures() noexcept -> completion_signatures { diff --git a/examples/just_stopped.cpp b/examples/just_stopped.cpp index fe9d5593..ec15cf8c 100644 --- a/examples/just_stopped.cpp +++ b/examples/just_stopped.cpp @@ -9,7 +9,7 @@ import beman.execution; namespace ex = beman::execution; struct receiver { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; auto set_value(auto&&...) noexcept -> void {} auto set_error(auto&&) noexcept -> void {} auto set_stopped() noexcept -> void {} diff --git a/examples/sender-demo.cpp b/examples/sender-demo.cpp index a4b4539b..c7522737 100644 --- a/examples/sender-demo.cpp +++ b/examples/sender-demo.cpp @@ -18,7 +18,7 @@ namespace ex = beman::execution; template struct just_op_state { - using operation_state_concept = ex::operation_state_t; + using operation_state_concept = ex::operation_state_tag; std::remove_cvref_t rec; std::pmr::string value; @@ -30,7 +30,7 @@ struct just_op_state { }; struct test_receiver { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; auto set_value(auto&&...) && noexcept -> void { std::cout << "set_value\n"; } auto set_error(auto&&) && noexcept -> void { std::cout << "set_error\n"; } auto set_stopped() && noexcept -> void { std::cout << "set_stopped\n"; } @@ -41,7 +41,7 @@ static_assert(ex::operation_state>); template struct just_sender { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; using completion_signatures = ex::completion_signatures; template static consteval auto get_completion_signatures() noexcept -> completion_signatures { diff --git a/examples/stackoverflow.cpp b/examples/stackoverflow.cpp index 089e47b3..71122d7b 100644 --- a/examples/stackoverflow.cpp +++ b/examples/stackoverflow.cpp @@ -15,7 +15,7 @@ import beman.execution; namespace ex = beman::execution; struct task { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; using completion_signatures = ex::completion_signatures; template static consteval auto get_completion_signatures() noexcept -> completion_signatures { @@ -54,7 +54,7 @@ struct task { template struct state : base { - using operation_state_concept = ex::operation_state_t; + using operation_state_concept = ex::operation_state_tag; std::remove_cvref_t r; std::coroutine_handle handle; diff --git a/examples/stopping.cpp b/examples/stopping.cpp index 962c9912..4fdfa1dd 100644 --- a/examples/stopping.cpp +++ b/examples/stopping.cpp @@ -33,11 +33,11 @@ struct env { template struct inject_cancel_sender { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; template struct receiver { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; std::remove_cvref_t inner_receiver; ex::inplace_stop_token token{}; @@ -73,7 +73,7 @@ template inject_cancel_sender(ex::inplace_stop_token, S&&) -> inject_cancel_sender>; struct receiver { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; auto set_value(auto&&...) noexcept -> void {} auto set_error(auto&&) noexcept -> void {} auto set_stopped() noexcept -> void {} diff --git a/examples/when_all-cancel.cpp b/examples/when_all-cancel.cpp index 30fb37a1..b80483ef 100644 --- a/examples/when_all-cancel.cpp +++ b/examples/when_all-cancel.cpp @@ -31,7 +31,7 @@ struct env { }; struct receiver { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; ex::inplace_stop_source* source; auto set_value() && noexcept -> void { std::cout << "set_value\n"; } @@ -43,7 +43,7 @@ struct receiver { static_assert(ex::receiver); struct await_stop { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; using completion_signatures = ex::completion_signatures; template static consteval auto get_completion_signatures() noexcept -> completion_signatures { @@ -62,7 +62,7 @@ struct await_stop { std::cout << "await_stop stopping done\n"; } }; - using operation_state_concept = ex::operation_state_t; + using operation_state_concept = ex::operation_state_tag; using token_t = decltype(ex::get_stop_token(ex::get_env(std::declval()))); using callback_t = ex::stop_callback_for_t; @@ -84,7 +84,7 @@ static_assert(ex::operation_state>); template struct eager { - using sender_concept = ex::sender_t; + using sender_concept = ex::sender_tag; using completion_signatures = ex::completion_signatures; template static consteval auto get_completion_signatures() noexcept -> completion_signatures { @@ -95,9 +95,9 @@ struct eager { template struct state { - using operation_state_concept = ex::operation_state_t; + using operation_state_concept = ex::operation_state_tag; struct receiver { - using receiver_concept = ex::receiver_t; + using receiver_concept = ex::receiver_tag; state* st; auto set_value() && noexcept -> void { ex::set_value(std::move(st->outer_receiver)); } template diff --git a/include/beman/execution/detail/almost_scheduler.hpp b/include/beman/execution/detail/almost_scheduler.hpp index 6c306f31..d8361473 100644 --- a/include/beman/execution/detail/almost_scheduler.hpp +++ b/include/beman/execution/detail/almost_scheduler.hpp @@ -14,12 +14,12 @@ import std; #ifdef BEMAN_HAS_MODULES import beman.execution.detail.queryable; import beman.execution.detail.schedule; -import beman.execution.detail.scheduler_t; +import beman.execution.detail.scheduler_tag; import beman.execution.detail.sender; #else #include #include -#include +#include #include #endif @@ -34,7 +34,7 @@ namespace beman::execution::detail { */ template concept almost_scheduler = ::std::derived_from::scheduler_concept, - ::beman::execution::scheduler_t> && + ::beman::execution::scheduler_tag> && ::beman::execution::detail::queryable && requires(Scheduler&& sched) { { diff --git a/include/beman/execution/detail/as_awaitable.hpp b/include/beman/execution/detail/as_awaitable.hpp index 0119d693..40470efd 100644 --- a/include/beman/execution/detail/as_awaitable.hpp +++ b/include/beman/execution/detail/as_awaitable.hpp @@ -56,9 +56,9 @@ struct as_awaitable_t { ::beman::execution::detail::query_with_default(::beman::execution::get_await_completion_adaptor, ::beman::execution::get_env(expr), ::std::identity{}); - using sender_t = ::std::invoke_result_t; - if constexpr (::beman::execution::detail::awaitable_sender) { - return ::beman::execution::detail::sender_awaitable{ + using sender_tag = ::std::invoke_result_t; + if constexpr (::beman::execution::detail::awaitable_sender) { + return ::beman::execution::detail::sender_awaitable{ adaptor(::std::forward(expr)), promise}; } else if constexpr (::beman::execution::detail::awaitable_sender) { return ::beman::execution::detail::sender_awaitable{::std::forward(expr), diff --git a/include/beman/execution/detail/basic_operation.hpp b/include/beman/execution/detail/basic_operation.hpp index de6cf11d..a68fd2bd 100644 --- a/include/beman/execution/detail/basic_operation.hpp +++ b/include/beman/execution/detail/basic_operation.hpp @@ -51,7 +51,7 @@ template //-dk:TODO detail export 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 operation_state_concept = ::beman::execution::operation_state_tag; using tag_t = ::beman::execution::tag_of_t; using inner_ops_t = ::beman::execution::detail::connect_all_result; diff --git a/include/beman/execution/detail/basic_receiver.hpp b/include/beman/execution/detail/basic_receiver.hpp index da85dce8..92308768 100644 --- a/include/beman/execution/detail/basic_receiver.hpp +++ b/include/beman/execution/detail/basic_receiver.hpp @@ -57,7 +57,7 @@ template friend struct ::beman::execution::set_stopped_t; friend struct ::beman::execution::set_value_t; - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; using tag_t = ::beman::execution::tag_of_t; using state_t = ::beman::execution::detail::state_type; static constexpr const auto& complete = ::beman::execution::detail::get_impls_for::complete(); diff --git a/include/beman/execution/detail/basic_sender.hpp b/include/beman/execution/detail/basic_sender.hpp index 46adf852..028c0b21 100644 --- a/include/beman/execution/detail/basic_sender.hpp +++ b/include/beman/execution/detail/basic_sender.hpp @@ -66,7 +66,7 @@ inline constexpr sub_apply_t sub_apply{}; template struct basic_sender : ::beman::execution::detail::product_type { //-dk:TODO friend struct ::beman::execution::detail::connect_t; - using sender_concept = ::beman::execution::sender_t; + using sender_concept = ::beman::execution::sender_tag; using is_basic_sender_tag = void; //-dk:TODO need a better way to detect this is a basic sender using indices_for = ::std::index_sequence_for; static constexpr ::std::integral_constant<::std::size_t, sizeof...(Child) + 2> size{}; diff --git a/include/beman/execution/detail/inline_scheduler.hpp b/include/beman/execution/detail/inline_scheduler.hpp index ac2d364f..653d8a3f 100644 --- a/include/beman/execution/detail/inline_scheduler.hpp +++ b/include/beman/execution/detail/inline_scheduler.hpp @@ -19,7 +19,7 @@ import beman.execution.detail.receiver; import beman.execution.detail.set_value; import beman.execution.detail.operation_state; import beman.execution.detail.scheduler; -import beman.execution.detail.scheduler_t; +import beman.execution.detail.scheduler_tag; import beman.execution.detail.completion_signatures; #else #include @@ -33,7 +33,7 @@ import beman.execution.detail.completion_signatures; namespace beman::execution { struct inline_scheduler { - using scheduler_concept = ::beman::execution::scheduler_t; + using scheduler_concept = ::beman::execution::scheduler_tag; struct env { static auto @@ -45,13 +45,13 @@ struct inline_scheduler { template <::beman::execution::receiver Rcvr> struct state { - using operation_state_concept = ::beman::execution::operation_state_t; + using operation_state_concept = ::beman::execution::operation_state_tag; ::std::remove_cvref_t rcvr; auto start() & noexcept -> void { ::beman::execution::set_value(::std::move(rcvr)); } }; struct sender { - using sender_concept = ::beman::execution::sender_t; + using sender_concept = ::beman::execution::sender_tag; using completion_signatures = ::beman::execution::completion_signatures<::beman::execution::set_value_t()>; template static consteval auto get_completion_signatures() noexcept -> completion_signatures { diff --git a/include/beman/execution/detail/let.hpp b/include/beman/execution/detail/let.hpp index 2f3f85e2..bdf0fc71 100644 --- a/include/beman/execution/detail/let.hpp +++ b/include/beman/execution/detail/let.hpp @@ -204,7 +204,7 @@ struct let_t { template struct let_receiver { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; Receiver& receiver; Env env; diff --git a/include/beman/execution/detail/on.hpp b/include/beman/execution/detail/on.hpp index 84341323..4d29a1e8 100644 --- a/include/beman/execution/detail/on.hpp +++ b/include/beman/execution/detail/on.hpp @@ -76,7 +76,7 @@ struct on_t : ::beman::execution::sender_adaptor_closure { template struct env_needs_get_scheduler { - using sender_concept = ::beman::execution::sender_t; + using sender_concept = ::beman::execution::sender_tag; template static constexpr auto get_completion_signatures() { return env_needs_get_scheduler{}; diff --git a/include/beman/execution/detail/operation_state.hpp b/include/beman/execution/detail/operation_state.hpp index e1b398e3..50fdbfdd 100644 --- a/include/beman/execution/detail/operation_state.hpp +++ b/include/beman/execution/detail/operation_state.hpp @@ -20,11 +20,13 @@ import beman.execution.detail.start; // ---------------------------------------------------------------------------- namespace beman::execution { -struct operation_state_t {}; +struct operation_state_tag {}; + +using operation_state_t [[deprecated("operation_state_t has been renamed operation_state_tag")]] = operation_state_tag; template concept operation_state = - ::std::derived_from && + ::std::derived_from && ::std::is_object_v && requires(State& state) { { ::beman::execution::start(state) } noexcept; }; diff --git a/include/beman/execution/detail/operation_state_task.hpp b/include/beman/execution/detail/operation_state_task.hpp index e2b01e44..8209d1a2 100644 --- a/include/beman/execution/detail/operation_state_task.hpp +++ b/include/beman/execution/detail/operation_state_task.hpp @@ -66,7 +66,7 @@ struct beman::execution::detail::connect_awaitable_promise template struct beman::execution::detail::operation_state_task { - using operation_state_concept = ::beman::execution::operation_state_t; + using operation_state_concept = ::beman::execution::operation_state_tag; using promise_type = ::beman::execution::detail::connect_awaitable_promise; explicit operation_state_task(::std::coroutine_handle<> hndl) noexcept : handle(hndl) {} diff --git a/include/beman/execution/detail/receiver.hpp b/include/beman/execution/detail/receiver.hpp index a94d48f7..ec4557a3 100644 --- a/include/beman/execution/detail/receiver.hpp +++ b/include/beman/execution/detail/receiver.hpp @@ -22,11 +22,13 @@ import beman.execution.detail.queryable; // ---------------------------------------------------------------------------- namespace beman::execution { -struct receiver_t {}; +struct receiver_tag {}; + +using receiver_t [[deprecated("receiver_t has been renamed receiver_tag")]] = receiver_tag; template concept receiver = - ::std::derived_from::receiver_concept, ::beman::execution::receiver_t> && + ::std::derived_from::receiver_concept, ::beman::execution::receiver_tag> && requires(const ::std::remove_cvref_t& rcvr) { { ::beman::execution::get_env(rcvr) } -> ::beman::execution::detail::queryable; } && ::std::move_constructible<::std::remove_cvref_t> && diff --git a/include/beman/execution/detail/run_loop.hpp b/include/beman/execution/detail/run_loop.hpp index b05369f4..50777110 100644 --- a/include/beman/execution/detail/run_loop.hpp +++ b/include/beman/execution/detail/run_loop.hpp @@ -24,7 +24,7 @@ import beman.execution.detail.get_stop_token; import beman.execution.detail.immovable; import beman.execution.detail.operation_state; import beman.execution.detail.scheduler; -import beman.execution.detail.scheduler_t; +import beman.execution.detail.scheduler_tag; import beman.execution.detail.sender; import beman.execution.detail.set_stopped; import beman.execution.detail.set_value; @@ -67,7 +67,7 @@ class run_loop { template struct opstate : opstate_base { - using operation_state_concept = ::beman::execution::operation_state_t; + using operation_state_concept = ::beman::execution::operation_state_tag; run_loop* loop; Receiver receiver; @@ -89,7 +89,7 @@ class run_loop { } }; struct sender { - using sender_concept = ::beman::execution::sender_t; + using sender_concept = ::beman::execution::sender_tag; template static consteval auto get_completion_signatures() noexcept { if constexpr (::beman::execution::unstoppable_token struct upstream_receiver { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; State* state; auto set_value() && noexcept -> void { @@ -166,18 +166,18 @@ struct schedule_from_t { }; template struct state_type : state_base { - using receiver_t = upstream_receiver>; + using receiver_tag = upstream_receiver>; using operation_t = - ::beman::execution::connect_result_t<::beman::execution::schedule_result_t, receiver_t>; + ::beman::execution::connect_result_t<::beman::execution::schedule_result_t, receiver_tag>; operation_t op_state; static constexpr bool nothrow() { return noexcept(::beman::execution::connect(::beman::execution::schedule(::std::declval()), - receiver_t{nullptr})); + receiver_tag{nullptr})); } explicit state_type(Scheduler& sch, Receiver& rcvr) noexcept(nothrow()) : state_base{rcvr}, - op_state(::beman::execution::connect(::beman::execution::schedule(sch), receiver_t{this})) {} + op_state(::beman::execution::connect(::beman::execution::schedule(sch), receiver_tag{this})) {} }; struct get_attrs_impl { diff --git a/include/beman/execution/detail/scheduler_t.hpp b/include/beman/execution/detail/scheduler_tag.hpp similarity index 56% rename from include/beman/execution/detail/scheduler_t.hpp rename to include/beman/execution/detail/scheduler_tag.hpp index 45b415cd..9e317e3a 100644 --- a/include/beman/execution/detail/scheduler_t.hpp +++ b/include/beman/execution/detail/scheduler_tag.hpp @@ -1,8 +1,8 @@ -// include/beman/execution/detail/scheduler_t.hpp -*-C++-*- +// include/beman/execution/detail/scheduler_tag.hpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef INCLUDED_BEMAN_EXECUTION_DETAIL_SCHEDULER_T -#define INCLUDED_BEMAN_EXECUTION_DETAIL_SCHEDULER_T +#ifndef INCLUDED_BEMAN_EXECUTION_DETAIL_SCHEDULER_TAG +#define INCLUDED_BEMAN_EXECUTION_DETAIL_SCHEDULER_TAG #include @@ -13,9 +13,11 @@ namespace beman::execution { * \brief Tag type to indicate a class is a scheduler. * \headerfile beman/execution/execution.hpp */ -struct scheduler_t {}; +struct scheduler_tag {}; + +using scheduler_t [[deprecated("scheduler_t has been renamed scheduler_tag")]] = scheduler_tag; } // namespace beman::execution // ---------------------------------------------------------------------------- -#endif // INCLUDED_BEMAN_EXECUTION_DETAIL_SCHEDULER_T +#endif // INCLUDED_BEMAN_EXECUTION_DETAIL_SCHEDULER_TAG diff --git a/include/beman/execution/detail/scope_token.hpp b/include/beman/execution/detail/scope_token.hpp index fda5511e..3cb7459b 100644 --- a/include/beman/execution/detail/scope_token.hpp +++ b/include/beman/execution/detail/scope_token.hpp @@ -30,7 +30,7 @@ namespace beman::execution::detail { struct token_test_env {}; struct token_test_sender { - using sender_concept = ::beman::execution::sender_t; + using sender_concept = ::beman::execution::sender_tag; template static consteval auto get_completion_signatures() noexcept { return ::beman::execution::completion_signatures<>{}; diff --git a/include/beman/execution/detail/sender.hpp b/include/beman/execution/detail/sender.hpp index 80de7c50..eecdcab5 100644 --- a/include/beman/execution/detail/sender.hpp +++ b/include/beman/execution/detail/sender.hpp @@ -28,11 +28,13 @@ import beman.execution.detail.queryable; // ---------------------------------------------------------------------------- namespace beman::execution { -struct sender_t {}; +struct sender_tag {}; + +using sender_t [[deprecated("sender_t has been renamed sender_tag")]] = sender_tag; } // namespace beman::execution namespace beman::execution::detail { template -concept is_sender = ::std::derived_from; +concept is_sender = ::std::derived_from; template concept enable_sender = diff --git a/include/beman/execution/detail/sender_awaitable.hpp b/include/beman/execution/detail/sender_awaitable.hpp index 4a7571f0..88ab82e6 100644 --- a/include/beman/execution/detail/sender_awaitable.hpp +++ b/include/beman/execution/detail/sender_awaitable.hpp @@ -57,7 +57,7 @@ class sender_awaitable { using data_type = ::std::tuple, ::std::coroutine_handle>; struct awaitable_receiver { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; void resume() { if (not enable_defence || ::std::get<1>(*result_ptr_).exchange(true, std::memory_order_acq_rel)) { diff --git a/include/beman/execution/detail/spawn.hpp b/include/beman/execution/detail/spawn.hpp index 8d55d5c9..239bc237 100644 --- a/include/beman/execution/detail/spawn.hpp +++ b/include/beman/execution/detail/spawn.hpp @@ -43,7 +43,7 @@ struct spawn_t { }; struct receiver { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; state_base* state{}; auto set_value() && noexcept -> void { this->state->complete(); } @@ -87,8 +87,8 @@ struct spawn_t { auto new_sender{tok.wrap(::std::forward(sender))}; auto [all, senv] = ::beman::execution::detail::spawn_get_allocator(new_sender, env); - using sender_t = decltype(::beman::execution::write_env(::std::move(new_sender), senv)); - using state_t = state; + using sender_tag = decltype(::beman::execution::write_env(::std::move(new_sender), senv)); + using state_t = state; using alloc_t = typename ::std::allocator_traits::template rebind_alloc; using traits_t = ::std::allocator_traits; alloc_t alloc(all); diff --git a/include/beman/execution/detail/spawn_future.hpp b/include/beman/execution/detail/spawn_future.hpp index 7325aa8c..5071b818 100644 --- a/include/beman/execution/detail/spawn_future.hpp +++ b/include/beman/execution/detail/spawn_future.hpp @@ -106,7 +106,7 @@ struct spawn_future_state_base<::beman::execution::completion_signatures struct spawn_future_receiver { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; using state_t = ::beman::execution::detail::spawn_future_state_base; state_t* state{}; @@ -156,22 +156,22 @@ struct spawn_future_state using traits_t = ::std::allocator_traits; using spawned_sender_t = ::beman::execution::detail::future_spawned_sender; using sigs_t = ::beman::execution::detail::spawn_future_sigs; - using receiver_t = ::beman::execution::detail::spawn_future_receiver; + using receiver_tag = ::beman::execution::detail::spawn_future_receiver; static_assert(::beman::execution::sender); - static_assert(::beman::execution::receiver); - using op_t = ::beman::execution::connect_result_t; + static_assert(::beman::execution::receiver); + using op_t = ::beman::execution::connect_result_t; template <::beman::execution::sender S> spawn_future_state(auto a, S&& s, Token tok, Env env) : alloc(::std::move(a)), op(::beman::execution::write_env( ::beman::execution::detail::stop_when(::std::forward(s), source.get_token()), env), - receiver_t{this}), + receiver_tag{this}), assoc(tok.try_associate()) { if (this->assoc) { ::beman::execution::start(this->op); } else { - ::beman::execution::set_stopped(receiver_t{this}); + ::beman::execution::set_stopped(receiver_tag{this}); } } auto complete() noexcept -> void override { diff --git a/include/beman/execution/detail/split.hpp b/include/beman/execution/detail/split.hpp index a573736d..ca920362 100644 --- a/include/beman/execution/detail/split.hpp +++ b/include/beman/execution/detail/split.hpp @@ -100,7 +100,7 @@ struct impls_for : ::beman::execution::detail::default_impls { template struct split_receiver { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; explicit split_receiver(shared_state* state) noexcept : sh_state(state) { if (sh_state) { diff --git a/include/beman/execution/detail/stop_when.hpp b/include/beman/execution/detail/stop_when.hpp index 014e9bf1..77cbe9e9 100644 --- a/include/beman/execution/detail/stop_when.hpp +++ b/include/beman/execution/detail/stop_when.hpp @@ -60,7 +60,7 @@ inline constexpr struct stop_when_t { template <::beman::execution::sender Sndr, ::beman::execution::stoppable_token Tok> struct beman::execution::detail::stop_when_t::sender { - using sender_concept = ::beman::execution::sender_t; + using sender_concept = ::beman::execution::sender_tag; stop_when_t stop_when{}; std::remove_cvref_t tok; @@ -68,7 +68,7 @@ struct beman::execution::detail::stop_when_t::sender { template <::beman::execution::receiver Rcvr> struct state { - using operation_state_concept = ::beman::execution::operation_state_t; + using operation_state_concept = ::beman::execution::operation_state_tag; using rcvr_t = ::std::remove_cvref_t; using token1_t = ::std::remove_cvref_t; using token2_t = @@ -97,7 +97,7 @@ struct beman::execution::detail::stop_when_t::sender { }; struct receiver { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; base_state* st; auto get_env() const noexcept -> env { return env{this->st}; } diff --git a/include/beman/execution/detail/store_receiver.hpp b/include/beman/execution/detail/store_receiver.hpp index 54d88941..d14b71cd 100644 --- a/include/beman/execution/detail/store_receiver.hpp +++ b/include/beman/execution/detail/store_receiver.hpp @@ -46,7 +46,7 @@ namespace beman::execution::detail { struct store_receiver_t { template <::beman::execution::receiver Rcvr> struct receiver { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; Rcvr* rcvr; template auto set_value(Args&&... args) && noexcept -> void { @@ -61,7 +61,7 @@ struct store_receiver_t { }; template <::beman::execution::sender Sndr, typename Trans, ::beman::execution::receiver Rcvr> struct state { - using operation_state_concept = ::beman::execution::operation_state_t; + using operation_state_concept = ::beman::execution::operation_state_tag; using env_t = ::beman::execution::env_of_t; using state_t = ::beman::execution::connect_result_t()( ::std::declval(), ::std::declval())), @@ -78,7 +78,7 @@ struct store_receiver_t { }; template <::beman::execution::sender Sndr, typename Trans> struct sender { - using sender_concept = ::beman::execution::sender_t; + using sender_concept = ::beman::execution::sender_tag; using trans_t = ::std::remove_cvref_t; template static consteval auto get_completion_signatures() noexcept { diff --git a/include/beman/execution/detail/sync_wait.hpp b/include/beman/execution/detail/sync_wait.hpp index 253b52d6..e7ba372a 100644 --- a/include/beman/execution/detail/sync_wait.hpp +++ b/include/beman/execution/detail/sync_wait.hpp @@ -70,7 +70,7 @@ struct sync_wait_state { template // dk:TODO detail export struct sync_wait_receiver { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; ::beman::execution::detail::sync_wait_state* state{}; diff --git a/include/beman/execution26/execution.hpp b/include/beman/execution26/execution.hpp index 9c533235..d414719b 100644 --- a/include/beman/execution26/execution.hpp +++ b/include/beman/execution26/execution.hpp @@ -61,11 +61,11 @@ using ::beman::execution::let_stopped_t; using ::beman::execution::let_value; using ::beman::execution::let_value_t; using ::beman::execution::operation_state; -using ::beman::execution::operation_state_t; +using ::beman::execution::operation_state_tag; using ::beman::execution::read_env; using ::beman::execution::receiver; using ::beman::execution::receiver_of; -using ::beman::execution::receiver_t; +using ::beman::execution::receiver_tag; using ::beman::execution::run_loop; using ::beman::execution::schedule; using ::beman::execution::schedule_from; @@ -73,11 +73,11 @@ using ::beman::execution::schedule_from_t; using ::beman::execution::schedule_result_t; using ::beman::execution::schedule_t; using ::beman::execution::scheduler; -using ::beman::execution::scheduler_t; +using ::beman::execution::scheduler_tag; using ::beman::execution::sender; using ::beman::execution::sender_adaptor_closure; using ::beman::execution::sender_in; -using ::beman::execution::sender_t; +using ::beman::execution::sender_tag; using ::beman::execution::sends_stopped; using ::beman::execution::set_error; using ::beman::execution::set_error_t; diff --git a/src/beman/execution/CMakeLists.txt b/src/beman/execution/CMakeLists.txt index 674d52c5..24d6c881 100644 --- a/src/beman/execution/CMakeLists.txt +++ b/src/beman/execution/CMakeLists.txt @@ -147,7 +147,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/schedule_from.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/schedule_result_t.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/scheduler.hpp - ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/scheduler_t.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/scheduler_tag.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/scope_association.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/scope_token.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/sender.hpp @@ -340,7 +340,7 @@ if(BEMAN_USE_MODULES) schedule_from.cppm schedule_result_t.cppm schedule.cppm - scheduler_t.cppm + scheduler_tag.cppm scheduler.cppm scope_association.cppm scope_token.cppm diff --git a/src/beman/execution/execution.cppm b/src/beman/execution/execution.cppm index 3de60d3c..ed7d6579 100644 --- a/src/beman/execution/execution.cppm +++ b/src/beman/execution/execution.cppm @@ -50,7 +50,7 @@ import beman.execution.detail.schedule; import beman.execution.detail.schedule_from; export import beman.execution.detail.schedule_result_t; export import beman.execution.detail.scheduler; // [exec.sched], schedulers -export import beman.execution.detail.scheduler_t; +export import beman.execution.detail.scheduler_tag; export import beman.execution.detail.scope_association; // [exec.scope.concepts] export import beman.execution.detail.scope_token; // [exec.scope.concepts] import beman.execution.detail.sender_adaptor_closure; diff --git a/src/beman/execution/operation_state.cppm b/src/beman/execution/operation_state.cppm index fc5ffc0f..7215ed7c 100644 --- a/src/beman/execution/operation_state.cppm +++ b/src/beman/execution/operation_state.cppm @@ -7,6 +7,7 @@ module; export module beman.execution.detail.operation_state; namespace beman::execution { +export using beman::execution::operation_state_tag; export using beman::execution::operation_state_t; export using beman::execution::operation_state; } // namespace beman::execution diff --git a/src/beman/execution/receiver.cppm b/src/beman/execution/receiver.cppm index ac4f2886..aa18772d 100644 --- a/src/beman/execution/receiver.cppm +++ b/src/beman/execution/receiver.cppm @@ -7,6 +7,7 @@ module; export module beman.execution.detail.receiver; namespace beman::execution { +export using beman::execution::receiver_tag; export using beman::execution::receiver_t; export using beman::execution::receiver; } // namespace beman::execution diff --git a/src/beman/execution/scheduler_t.cppm b/src/beman/execution/scheduler_t.cppm deleted file mode 100644 index 887923a8..00000000 --- a/src/beman/execution/scheduler_t.cppm +++ /dev/null @@ -1,11 +0,0 @@ -module; -// src/beman/execution/scheduler_t.cppm -*-C++-*- -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#include - -export module beman.execution.detail.scheduler_t; - -namespace beman::execution { -export using beman::execution::scheduler_t; -} // namespace beman::execution diff --git a/src/beman/execution/scheduler_tag.cppm b/src/beman/execution/scheduler_tag.cppm new file mode 100644 index 00000000..1536a481 --- /dev/null +++ b/src/beman/execution/scheduler_tag.cppm @@ -0,0 +1,12 @@ +module; +// src/beman/execution/scheduler_tag.cppm -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +export module beman.execution.detail.scheduler_tag; + +namespace beman::execution { +export using beman::execution::scheduler_tag; +export using beman::execution::scheduler_t; +} // namespace beman::execution diff --git a/src/beman/execution/sender.cppm b/src/beman/execution/sender.cppm index 3049e8a3..fc78289b 100644 --- a/src/beman/execution/sender.cppm +++ b/src/beman/execution/sender.cppm @@ -7,6 +7,7 @@ module; export module beman.execution.detail.sender; namespace beman::execution { +export using beman::execution::sender_tag; export using beman::execution::sender_t; export using beman::execution::sender; export using beman::execution::enable_sender; diff --git a/tests/beman/execution/exec-affine-on.test.cpp b/tests/beman/execution/exec-affine-on.test.cpp index b3cc19bf..60e6d5bd 100644 --- a/tests/beman/execution/exec-affine-on.test.cpp +++ b/tests/beman/execution/exec-affine-on.test.cpp @@ -49,7 +49,7 @@ struct awaiter { }; template struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; Sched scheduler_; awaiter* awaiter_{nullptr}; auto set_value(auto&&...) && noexcept -> void { this->awaiter_&& this->awaiter_->complete(); } @@ -62,7 +62,7 @@ template receiver(Sched, awaiter* = nullptr) -> receiver; struct test_scheduler { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; struct data { std::size_t connected_{}; @@ -72,7 +72,7 @@ struct test_scheduler { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver_; data* data_; auto start() & noexcept -> void { @@ -81,7 +81,7 @@ struct test_scheduler { } }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() -> test_std::completion_signatures { return {}; diff --git a/tests/beman/execution/exec-connect.test.cpp b/tests/beman/execution/exec-connect.test.cpp index d440d684..d52cc823 100644 --- a/tests/beman/execution/exec-connect.test.cpp +++ b/tests/beman/execution/exec-connect.test.cpp @@ -23,7 +23,7 @@ namespace { enum class kind : unsigned char { plain, domain }; template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; int value{}; std::remove_cvref_t receiver; @@ -38,7 +38,7 @@ struct state { }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; int value{}; template @@ -48,7 +48,7 @@ struct sender { }; struct rvalue_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; int value{}; explicit rvalue_sender(int val) : value(val) {} @@ -69,7 +69,7 @@ struct env { }; struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; int value{}; bool* set_stopped_called{}; @@ -86,7 +86,7 @@ struct receiver { }; struct domain_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; int value{}; template @@ -106,7 +106,7 @@ struct domain_env { }; struct domain_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; int value{}; explicit domain_receiver(int val) : value(val) {} @@ -168,7 +168,7 @@ auto test_connect_awaitable_promise() -> void { auto test_operation_state_task() -> void { using state_t = test_detail::operation_state_task; - static_assert(std::same_as<::beman::execution::operation_state_t, state_t::operation_state_concept>); + static_assert(std::same_as<::beman::execution::operation_state_tag, state_t::operation_state_concept>); static_assert(std::same_as, state_t::promise_type>); static_assert(noexcept(state_t(std::coroutine_handle<>{}))); state_t state(::std::coroutine_handle<>{}); @@ -229,7 +229,7 @@ auto test_connect_awaitable() -> void { }; struct local_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; int& iv; bool& bv; @@ -306,7 +306,7 @@ auto test_connect_with_awaiter() -> void { auto await_resume() -> int { return 17; } }; struct local_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; bool& result; auto set_value(int i) && noexcept -> void { this->result = i == 17; } auto set_error(const std::exception_ptr&) && noexcept -> void {} diff --git a/tests/beman/execution/exec-continues-on.test.cpp b/tests/beman/execution/exec-continues-on.test.cpp index 8a025042..7fe402ac 100644 --- a/tests/beman/execution/exec-continues-on.test.cpp +++ b/tests/beman/execution/exec-continues-on.test.cpp @@ -29,11 +29,11 @@ struct scheduler { struct sender { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; auto start() & noexcept -> void { test_std::set_value(::std::move(this->receiver)); } }; - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; auto get_env() const noexcept -> env { return {}; } template @@ -41,19 +41,19 @@ struct scheduler { return {std::forward(receiver)}; } }; - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() -> sender { return {}; } auto operator==(const scheduler&) const -> bool = default; auto query(const test_std::get_domain_t&) const noexcept -> custom_domain { return {}; } }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; auto start() & noexcept -> void { test_std::set_value(::std::move(this->receiver)); } }; diff --git a/tests/beman/execution/exec-domain-default.test.cpp b/tests/beman/execution/exec-domain-default.test.cpp index 57042766..a0131a32 100644 --- a/tests/beman/execution/exec-domain-default.test.cpp +++ b/tests/beman/execution/exec-domain-default.test.cpp @@ -27,7 +27,7 @@ struct tagged_env { struct non_sender {}; struct simple_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; int value{}; auto operator==(const simple_sender&) const -> bool = default; }; @@ -62,7 +62,7 @@ struct tag { template struct tagged_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; tag t{}; int value{17}; diff --git a/tests/beman/execution/exec-get-compl-sched.test.cpp b/tests/beman/execution/exec-get-compl-sched.test.cpp index 2ffb7c11..002dedc0 100644 --- a/tests/beman/execution/exec-get-compl-sched.test.cpp +++ b/tests/beman/execution/exec-get-compl-sched.test.cpp @@ -26,13 +26,13 @@ struct env; template struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; auto get_env() const noexcept -> env { return {}; } }; template struct scheduler { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; int value{}; auto operator==(const scheduler&) const -> bool = default; auto schedule() noexcept -> sender { return {}; } diff --git a/tests/beman/execution/exec-get-delegation-scheduler.test.cpp b/tests/beman/execution/exec-get-delegation-scheduler.test.cpp index 28070232..f0aab599 100644 --- a/tests/beman/execution/exec-get-delegation-scheduler.test.cpp +++ b/tests/beman/execution/exec-get-delegation-scheduler.test.cpp @@ -29,10 +29,10 @@ struct env { }; struct scheduler { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; int value{}; auto get_env() const noexcept -> env { return {this->value}; } }; diff --git a/tests/beman/execution/exec-getcomplsigs.test.cpp b/tests/beman/execution/exec-getcomplsigs.test.cpp index 20a15976..a5ed6620 100644 --- a/tests/beman/execution/exec-getcomplsigs.test.cpp +++ b/tests/beman/execution/exec-getcomplsigs.test.cpp @@ -23,16 +23,16 @@ struct other_env {}; template struct no_signatures_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; struct sender_with_typedef { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = signatures; }; struct sender_from_domain { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() noexcept { return signatures(); @@ -40,7 +40,7 @@ struct sender_from_domain { }; struct sender_with_get_completion_signatures { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() noexcept { if constexpr ((std::same_as && ... && true)) { diff --git a/tests/beman/execution/exec-into-variant.test.cpp b/tests/beman/execution/exec-into-variant.test.cpp index c90164ec..89e52f91 100644 --- a/tests/beman/execution/exec-into-variant.test.cpp +++ b/tests/beman/execution/exec-into-variant.test.cpp @@ -23,11 +23,11 @@ import beman.execution; namespace { struct non_sender {}; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; template , typename... T> struct sender_in { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() -> Signatures { return {}; @@ -43,7 +43,7 @@ template sender_in(T&&...) -> sender_in; struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; bool* called{}; @@ -82,7 +82,7 @@ auto test_into_variant(auto&& sender) -> void { } struct error_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; bool* called{}; @@ -101,7 +101,7 @@ auto test_into_variant_error() -> void { } struct stopped_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; bool* called{}; diff --git a/tests/beman/execution/exec-just.test.cpp b/tests/beman/execution/exec-just.test.cpp index eceea102..8feab9f9 100644 --- a/tests/beman/execution/exec-just.test.cpp +++ b/tests/beman/execution/exec-just.test.cpp @@ -68,7 +68,7 @@ auto test_just_constraints() -> void { template struct value_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; bool* called{}; test_detail::product_type...> expect{}; @@ -85,7 +85,7 @@ value_receiver(bool*, T&&...) -> value_receiver; template struct error_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; bool* called; std::decay_t error; @@ -100,7 +100,7 @@ template error_receiver(bool*, E&&) -> error_receiver; struct stopped_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; bool* called; @@ -164,7 +164,7 @@ struct memory_env { auto query(const test_std::get_allocator_t&) const noexcept { return allocator; } }; struct memory_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; std::pmr::polymorphic_allocator<> allocator; auto get_env() const noexcept { return memory_env{this->allocator}; } diff --git a/tests/beman/execution/exec-let.test.cpp b/tests/beman/execution/exec-let.test.cpp index 2cd8a8ee..a7a1e8ce 100644 --- a/tests/beman/execution/exec-let.test.cpp +++ b/tests/beman/execution/exec-let.test.cpp @@ -25,14 +25,14 @@ import beman.execution; namespace { struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto set_error(auto&&) && noexcept -> void {} auto set_stopped() && noexcept -> void {} auto set_value(auto&&...) && noexcept -> void {} }; template struct test_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template static consteval auto get_completion_signatures() { @@ -40,7 +40,7 @@ struct test_sender { } struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; auto start() & noexcept -> void {} }; auto connect(auto&&) -> state { return {}; } @@ -124,7 +124,7 @@ auto test_let_value_env() -> void { } struct all_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto set_value(auto&&...) && noexcept {} auto set_error(auto&&) && noexcept {} auto set_stopped() && noexcept {} diff --git a/tests/beman/execution/exec-on.test.cpp b/tests/beman/execution/exec-on.test.cpp index dd875e27..f5c92735 100644 --- a/tests/beman/execution/exec-on.test.cpp +++ b/tests/beman/execution/exec-on.test.cpp @@ -57,7 +57,7 @@ auto test_transform_sender(OutSndr out_sndr) -> void { } struct on_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; test::thread_pool& pool; auto set_value(auto&&...) && noexcept {} auto set_error(auto&&) && noexcept {} diff --git a/tests/beman/execution/exec-opstate.test.cpp b/tests/beman/execution/exec-opstate.test.cpp index 4d7a4811..091d6db0 100644 --- a/tests/beman/execution/exec-opstate.test.cpp +++ b/tests/beman/execution/exec-opstate.test.cpp @@ -12,15 +12,15 @@ import beman.execution; namespace { struct base {}; -struct opstate_base : test_std::operation_state_t {}; +struct opstate_base : test_std::operation_state_tag {}; struct non_operation_state {}; struct no_tag { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; auto start() noexcept {} }; struct no_start { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; auto start() noexcept {} }; @@ -37,16 +37,16 @@ auto test_operation_state() { } // namespace TEST(exec_opstate) { - test_std::operation_state_t state_tag{}; + test_std::operation_state_tag state_tag{}; (void)state_tag; test_operation_state(); test_operation_state(); test_operation_state(); - test_operation_state>(); - test_operation_state>(); + test_operation_state>(); + test_operation_state>(); test_operation_state>(); test_operation_state>(); - test_operation_state&>(); + test_operation_state&>(); } diff --git a/tests/beman/execution/exec-read-env.test.cpp b/tests/beman/execution/exec-read-env.test.cpp index aa1a4a80..526d2aa6 100644 --- a/tests/beman/execution/exec-read-env.test.cpp +++ b/tests/beman/execution/exec-read-env.test.cpp @@ -35,7 +35,7 @@ struct env { }; struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; int value{}; bool* called{}; diff --git a/tests/beman/execution/exec-recv-concepts.test.cpp b/tests/beman/execution/exec-recv-concepts.test.cpp index 7c8c3165..3bd019f7 100644 --- a/tests/beman/execution/exec-recv-concepts.test.cpp +++ b/tests/beman/execution/exec-recv-concepts.test.cpp @@ -20,22 +20,22 @@ struct error {}; template struct value_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto set_value(T...) && noexcept -> void {} }; template struct error_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto set_error(T) && noexcept -> void {} }; struct stopped_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto set_stopped() && noexcept -> void {} }; -template +template struct multi_receiver { using receiver_concept = Concept; diff --git a/tests/beman/execution/exec-recv.test.cpp b/tests/beman/execution/exec-recv.test.cpp index 02f9bfc9..64685216 100644 --- a/tests/beman/execution/exec-recv.test.cpp +++ b/tests/beman/execution/exec-recv.test.cpp @@ -13,7 +13,7 @@ import beman.execution.detail; namespace { struct base {}; -struct derived : test_std::receiver_t {}; +struct derived : test_std::receiver_tag {}; struct no_receiver_concept {}; struct receiver_concept_not_deriving_from_receiver_t { @@ -34,7 +34,7 @@ struct non_env { ~non_env() {} }; struct no_get_env { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto get_env() const noexcept -> const non_env& { static non_env rc; return rc; @@ -42,7 +42,7 @@ struct no_get_env { }; struct not_move_constructible { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; not_move_constructible() = default; not_move_constructible(const not_move_constructible&) = default; not_move_constructible(not_move_constructible&&) = delete; @@ -51,7 +51,7 @@ struct not_move_constructible { auto operator=(not_move_constructible&&) -> not_move_constructible& = delete; }; struct not_copy_constructible { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; not_copy_constructible() = default; not_copy_constructible(const not_copy_constructible&) = delete; not_copy_constructible(not_copy_constructible&&) = default; @@ -61,10 +61,10 @@ struct not_copy_constructible { }; struct receiver_final final { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; }; struct receiver_base { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; }; struct receiver_derived { using receiver_concept = derived; diff --git a/tests/beman/execution/exec-run-loop-types.test.cpp b/tests/beman/execution/exec-run-loop-types.test.cpp index 8a7fae53..27b43597 100644 --- a/tests/beman/execution/exec-run-loop-types.test.cpp +++ b/tests/beman/execution/exec-run-loop-types.test.cpp @@ -33,7 +33,7 @@ struct token_env { }; struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; signal_type* result; test_std::inplace_stop_token token; @@ -47,7 +47,7 @@ struct receiver { struct finish_receiver { test_std::run_loop* loop; - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto set_value() && noexcept { this->loop->finish(); } auto set_error(const std::exception_ptr&) && noexcept { this->loop->finish(); } diff --git a/tests/beman/execution/exec-sched.test.cpp b/tests/beman/execution/exec-sched.test.cpp index 363791a9..103a1627 100644 --- a/tests/beman/execution/exec-sched.test.cpp +++ b/tests/beman/execution/exec-sched.test.cpp @@ -24,7 +24,7 @@ struct env { template struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; auto get_env() const noexcept { return Env{}; } }; @@ -34,7 +34,7 @@ struct no_scheduler_concept { }; struct not_queryable { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; not_queryable() = default; not_queryable(const not_queryable&) = default; not_queryable(not_queryable&&) = default; @@ -46,17 +46,17 @@ struct not_queryable { }; struct no_schedule { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto operator==(const no_schedule&) const -> bool = default; }; struct not_equality_comparable { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() -> sender> { return {}; } }; struct not_copy_constructible { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; not_copy_constructible(const not_copy_constructible&) = delete; not_copy_constructible(not_copy_constructible&&) = default; ~not_copy_constructible() = default; @@ -67,13 +67,13 @@ struct not_copy_constructible { }; struct scheduler { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() -> sender> { return {}; } auto operator==(const scheduler&) const -> bool = default; }; struct bad_completion_scheduler { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() -> sender> { return {}; } auto operator==(const bad_completion_scheduler&) const -> bool = default; }; diff --git a/tests/beman/execution/exec-schedule-from.test.cpp b/tests/beman/execution/exec-schedule-from.test.cpp index 924b9e75..6bec88bc 100644 --- a/tests/beman/execution/exec-schedule-from.test.cpp +++ b/tests/beman/execution/exec-schedule-from.test.cpp @@ -26,11 +26,11 @@ struct scheduler { struct sender { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; auto start() & noexcept -> void { test_std::set_value(::std::move(this->receiver)); } }; - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() -> test_std::completion_signatures { return {}; @@ -41,12 +41,12 @@ struct scheduler { return {std::forward(receiver)}; } }; - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() -> sender { return {}; } auto operator==(const scheduler&) const -> bool = default; }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() -> test_std::completion_signatures { return {}; @@ -54,7 +54,7 @@ struct sender { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; auto start() & noexcept -> void { test_std::set_value(::std::move(this->receiver)); } }; diff --git a/tests/beman/execution/exec-schedule.test.cpp b/tests/beman/execution/exec-schedule.test.cpp index faabea86..46119c16 100644 --- a/tests/beman/execution/exec-schedule.test.cpp +++ b/tests/beman/execution/exec-schedule.test.cpp @@ -16,7 +16,7 @@ namespace { struct non_scheduler {}; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; int value{}; auto operator==(const sender&) const -> bool = default; }; diff --git a/tests/beman/execution/exec-scope-concepts.test.cpp b/tests/beman/execution/exec-scope-concepts.test.cpp index 18577867..b3960826 100644 --- a/tests/beman/execution/exec-scope-concepts.test.cpp +++ b/tests/beman/execution/exec-scope-concepts.test.cpp @@ -18,7 +18,7 @@ import beman.execution; namespace { struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; static_assert(test_std::sender); @@ -34,7 +34,7 @@ struct empty {}; template struct wrap { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; std::remove_cvref_t sndr; template static consteval auto get_completion_signatures() noexcept { @@ -45,7 +45,7 @@ static_assert(test_std::sender>); template struct bad { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; template diff --git a/tests/beman/execution/exec-scope-counting.test.cpp b/tests/beman/execution/exec-scope-counting.test.cpp index 430aff2a..ec023787 100644 --- a/tests/beman/execution/exec-scope-counting.test.cpp +++ b/tests/beman/execution/exec-scope-counting.test.cpp @@ -42,7 +42,7 @@ auto general() -> void { } struct join_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; struct env { auto query(const test_std::get_scheduler_t&) const noexcept -> test_std::inline_scheduler { return {}; } diff --git a/tests/beman/execution/exec-scope-simple-counting.test.cpp b/tests/beman/execution/exec-scope-simple-counting.test.cpp index 6c163686..30aec3c7 100644 --- a/tests/beman/execution/exec-scope-simple-counting.test.cpp +++ b/tests/beman/execution/exec-scope-simple-counting.test.cpp @@ -39,7 +39,7 @@ auto general() -> void { } struct join_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; struct env { auto query(const test_std::get_scheduler_t&) const noexcept -> test_std::inline_scheduler { return {}; } diff --git a/tests/beman/execution/exec-sender-adaptor-closure.test.cpp b/tests/beman/execution/exec-sender-adaptor-closure.test.cpp index a69b873f..af86f3da 100644 --- a/tests/beman/execution/exec-sender-adaptor-closure.test.cpp +++ b/tests/beman/execution/exec-sender-adaptor-closure.test.cpp @@ -17,7 +17,7 @@ namespace { // test helpers template struct wrapping_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; Sender inner; template @@ -55,7 +55,7 @@ struct wrong_crtp_closure : test_std::sender_adaptor_closure { struct double_inheritance_closure : identity_closure, test_std::sender_adaptor_closure {}; struct extended_closure : identity_closure {}; struct both_sender_and_closure : test_std::sender_adaptor_closure { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; struct incomplete; diff --git a/tests/beman/execution/exec-snd-apply.test.cpp b/tests/beman/execution/exec-snd-apply.test.cpp index 581ca62f..914f2866 100644 --- a/tests/beman/execution/exec-snd-apply.test.cpp +++ b/tests/beman/execution/exec-snd-apply.test.cpp @@ -37,7 +37,7 @@ struct tag { }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; int value{}; }; diff --git a/tests/beman/execution/exec-snd-concepts.test.cpp b/tests/beman/execution/exec-snd-concepts.test.cpp index 5a3a2be7..b1dce03a 100644 --- a/tests/beman/execution/exec-snd-concepts.test.cpp +++ b/tests/beman/execution/exec-snd-concepts.test.cpp @@ -22,10 +22,10 @@ import beman.execution.detail; namespace { struct non_sender {}; -struct own_sender_t : test_std::sender_t {}; +struct own_sender_t : test_std::sender_tag {}; struct std_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; struct own_sender { using sender_concept = own_sender_t; @@ -33,20 +33,20 @@ struct own_sender { struct tag_t {}; struct tagged_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; tag_t tag; int data; }; struct tagged_sender1 { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; tag_t tag; int data; int child1; }; struct tagged_sender2 { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; tag_t tag; int data; @@ -54,7 +54,7 @@ struct tagged_sender2 { int child2; }; struct tagged_sender3 { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; tag_t tag; int data; @@ -63,7 +63,7 @@ struct tagged_sender3 { int child3; }; struct tagged_sender4 { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; tag_t tag; int data; @@ -73,23 +73,23 @@ struct tagged_sender4 { int child4; }; struct product_sender0 : test_detail::product_type { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; }; struct product_sender1 : test_detail::product_type { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; }; struct product_sender2 : test_detail::product_type { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; }; struct product_sender3 : test_detail::product_type { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; }; struct product_sender4 : test_detail::product_type { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; }; @@ -133,7 +133,7 @@ auto test_sender() -> void { } struct sender_in { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() -> test_std::completion_signatures<> { return {}; @@ -186,7 +186,7 @@ auto test_sender_for() -> void { auto test_sender_to() -> void { struct int_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; static auto set_value(int) noexcept -> void {} }; diff --git a/tests/beman/execution/exec-snd-expos.test.cpp b/tests/beman/execution/exec-snd-expos.test.cpp index 67de17a6..31ca8b10 100644 --- a/tests/beman/execution/exec-snd-expos.test.cpp +++ b/tests/beman/execution/exec-snd-expos.test.cpp @@ -88,7 +88,7 @@ struct env2 { }; struct test_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; struct scheduler { @@ -104,7 +104,7 @@ struct tag { template struct operation_state : test_detail::immovable { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; int* counter; explicit operation_state(int* cntr) : counter(cntr) {} auto start() & noexcept -> void { ++*counter; } @@ -112,7 +112,7 @@ struct operation_state : test_detail::immovable { struct sender0 { struct env {}; - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; using indices_for = ::std::index_sequence_for<>; tag t{}; @@ -125,7 +125,7 @@ struct sender0 { }; struct sender1 { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; using indices_for = ::std::index_sequence_for; tag t{}; @@ -138,7 +138,7 @@ struct sender1 { }; struct sender2 { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; using indices_for = ::std::index_sequence_for; tag t{}; @@ -152,7 +152,7 @@ struct sender2 { }; struct sender3 { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; using indices_for = ::std::index_sequence_for; tag t{}; @@ -167,7 +167,7 @@ struct sender3 { }; struct sender4 { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; using indices_for = ::std::index_sequence_for; tag t{}; @@ -183,7 +183,7 @@ struct sender4 { }; struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto set_value(auto&&...) noexcept -> void {} auto set_error(auto&&) noexcept -> void {} auto set_stopped() noexcept -> void {} @@ -314,12 +314,12 @@ struct scheduler; template struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; auto get_env() const noexcept -> env { return {}; } }; template struct scheduler { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() noexcept -> sender { return {}; } auto operator==(const scheduler&) const -> bool = default; auto query(const test_std::get_domain_t&) const noexcept -> domain { return {}; } @@ -327,7 +327,7 @@ struct scheduler { template <> struct scheduler { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() noexcept -> sender { return {}; } auto operator==(const scheduler&) const -> bool = default; }; @@ -408,7 +408,7 @@ auto test_query_with_default() -> void { auto test_get_domain_early() -> void { struct plain_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; static_assert(test_std::sender); static_assert(std::same_as); @@ -418,7 +418,7 @@ auto test_get_domain_early() -> void { static_assert(std::same_as{}))>); struct sender_with_domain { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; struct domain {}; struct env { auto query(const test_std::get_domain_t&) const noexcept -> domain { return {}; } @@ -448,10 +448,10 @@ struct get_domain_late_scheduler { } }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; auto get_env() const noexcept -> env { return {}; } }; - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() noexcept -> sender { return {}; } auto operator==(const get_domain_late_scheduler&) const -> bool = default; auto query(const test_std::get_domain_t&) const noexcept -> dom { return {}; } @@ -468,7 +468,7 @@ struct get_domain_late_env { auto test_get_domain_late() -> void { struct no_domain_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; static_assert(test_std::sender); test_get_domain_late(no_domain_sender{}, test_std::env<>{}); @@ -491,7 +491,7 @@ auto test_get_domain_late() -> void { test_get_domain_late(no_domain_sender{}, domain_env{}); struct scheduler_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; auto get_env() const noexcept -> get_domain_late_scheduler::env { return {}; } }; static_assert(test_std::sender); @@ -501,7 +501,7 @@ auto test_get_domain_late() -> void { test_get_domain_late(scheduler_sender{}, test_std::env<>{}); struct env_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; auto get_env() const noexcept -> get_domain_late_env { return {}; } }; static_assert(test_std::sender); @@ -1047,7 +1047,7 @@ auto test_basic_operation() -> void { struct arg {}; struct local_env {}; struct completion_signatures_for_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using empty_env_sigs = test_std::completion_signatures; using env_sigs = test_std::completion_signatures; @@ -1089,11 +1089,11 @@ auto test_completion_signatures_for() -> void { struct basic_sender_tag { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; auto start() & noexcept -> void {} }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures<>; template static consteval auto get_completion_signatures() -> completion_signatures { @@ -1114,7 +1114,7 @@ struct basic_sender_tag { struct data {}; struct tagged_sender : test_detail::product_type { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; }; } // namespace @@ -1244,7 +1244,7 @@ struct write_env_added { }; struct write_env_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; bool* result{nullptr}; @@ -1253,7 +1253,7 @@ struct write_env_receiver { }; struct write_env_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template static consteval auto get_completion_signatures() -> completion_signatures { @@ -1261,7 +1261,7 @@ struct write_env_sender { } template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; auto start() & noexcept -> void { diff --git a/tests/beman/execution/exec-snd-transform.test.cpp b/tests/beman/execution/exec-snd-transform.test.cpp index 2a1a2497..e680c3ed 100644 --- a/tests/beman/execution/exec-snd-transform.test.cpp +++ b/tests/beman/execution/exec-snd-transform.test.cpp @@ -22,7 +22,7 @@ struct empty_domain {}; template struct final_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using index_type = std::integral_constant; int value{}; auto operator==(const final_sender&) const -> bool = default; @@ -44,7 +44,7 @@ struct tag { template struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using is_basic_sender_tag = void; using index_type = std::integral_constant; tag t; diff --git a/tests/beman/execution/exec-spawn-future.test.cpp b/tests/beman/execution/exec-spawn-future.test.cpp index d1ca5bb2..36aaf96d 100644 --- a/tests/beman/execution/exec-spawn-future.test.cpp +++ b/tests/beman/execution/exec-spawn-future.test.cpp @@ -45,7 +45,7 @@ static_assert(not test_std::sender); template struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template static consteval auto get_completion_signatures() -> completion_signatures { @@ -58,7 +58,7 @@ struct sender { }; template struct state : state_base { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t rcvr; state_base** handle{}; auto complete(T... a) -> void override { test_std::set_value(std::move(this->rcvr), a...); } @@ -290,7 +290,7 @@ struct alloc_env { }; struct alloc_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; int value{}; auto get_env() const noexcept -> alloc_env { return alloc_env{this->value}; } @@ -341,7 +341,7 @@ auto test_get_allocator() { } struct rcvr { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto set_value(auto&&...) && noexcept -> void {} auto set_error(auto&&) && noexcept -> void {} diff --git a/tests/beman/execution/exec-spawn.test.cpp b/tests/beman/execution/exec-spawn.test.cpp index c51474d0..5b51323a 100644 --- a/tests/beman/execution/exec-spawn.test.cpp +++ b/tests/beman/execution/exec-spawn.test.cpp @@ -27,7 +27,7 @@ struct env {}; template struct sender { - using sender_concept = std::conditional_t; + using sender_concept = std::conditional_t; using completion_signatures = test_std::completion_signatures; struct base { @@ -40,7 +40,7 @@ struct sender { std::remove_cvref_t rcvr; base*& handle; - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; state(auto&& r, base*& h) : rcvr(std::forward(r)), handle(h) {} auto start() & noexcept { this->handle = this; } auto complete() -> void override { test_std::set_value(std::move(this->rcvr)); } diff --git a/tests/beman/execution/exec-split.test.cpp b/tests/beman/execution/exec-split.test.cpp index cc6135a6..511ca11d 100644 --- a/tests/beman/execution/exec-split.test.cpp +++ b/tests/beman/execution/exec-split.test.cpp @@ -22,7 +22,7 @@ import beman.execution.detail; namespace { -struct timed_scheduler_t : beman::execution::scheduler_t {}; +struct timed_scheduler_t : beman::execution::scheduler_tag {}; class some_thread_pool { public: @@ -55,7 +55,7 @@ struct some_thread_pool_scheduler { template struct timed_operation { - using operation_state_concept = beman::execution::operation_state_t; + using operation_state_concept = beman::execution::operation_state_tag; Receiver receiver_; some_thread_pool& pool_; @@ -72,7 +72,7 @@ struct some_thread_pool_scheduler { }; struct timed_sender { - using sender_concept = beman::execution::sender_t; + using sender_concept = beman::execution::sender_tag; using completion_signatures = beman::execution::completion_signatures struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; auto start() & noexcept -> void { test_std::set_value(::std::move(this->receiver)); } }; - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() -> test_std::completion_signatures { return {}; @@ -41,12 +41,12 @@ struct scheduler { return {std::forward(receiver)}; } }; - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() -> sender { return {}; } auto operator==(const scheduler&) const -> bool = default; }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() -> test_std::completion_signatures { return {}; @@ -54,7 +54,7 @@ struct sender { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; auto start() & noexcept -> void { test_std::set_value(::std::move(this->receiver)); } }; diff --git a/tests/beman/execution/exec-stop-when.test.cpp b/tests/beman/execution/exec-stop-when.test.cpp index 434a214f..e15a91ab 100644 --- a/tests/beman/execution/exec-stop-when.test.cpp +++ b/tests/beman/execution/exec-stop-when.test.cpp @@ -32,12 +32,12 @@ import beman.execution.detail; namespace { struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; using rcvr_t = std::remove_cvref_t; using token_t = decltype(test_std::get_stop_token(test_std::get_env(std::declval()))); @@ -72,7 +72,7 @@ struct env { enum class completion : char { none, value, stopped }; struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; test_std::inplace_stop_token token; completion& comp; diff --git a/tests/beman/execution/exec-sync-wait-with-variant.test.cpp b/tests/beman/execution/exec-sync-wait-with-variant.test.cpp index 0fee6c29..169cf255 100644 --- a/tests/beman/execution/exec-sync-wait-with-variant.test.cpp +++ b/tests/beman/execution/exec-sync-wait-with-variant.test.cpp @@ -21,7 +21,7 @@ namespace { template struct just_variant { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template @@ -31,7 +31,7 @@ struct just_variant { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; auto start() & noexcept -> void { std::visit([this](auto v) { test_std::set_value(std::move(receiver), std::move(v)); }, std::move(var)); diff --git a/tests/beman/execution/exec-sync-wait.test.cpp b/tests/beman/execution/exec-sync-wait.test.cpp index 3c18f3a4..864b1ea9 100644 --- a/tests/beman/execution/exec-sync-wait.test.cpp +++ b/tests/beman/execution/exec-sync-wait.test.cpp @@ -28,11 +28,11 @@ struct error : std::exception { explicit error(int v) : value(v) {} }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; struct sender_in { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; @@ -43,7 +43,7 @@ struct sender_in { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; @@ -57,7 +57,7 @@ struct sender_in { }; struct send_error { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std:: completion_signatures; template @@ -67,7 +67,7 @@ struct send_error { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; int value; @@ -84,7 +84,7 @@ struct send_error { }; struct send_stopped { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std:: completion_signatures; template @@ -94,7 +94,7 @@ struct send_stopped { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; diff --git a/tests/beman/execution/exec-then.test.cpp b/tests/beman/execution/exec-then.test.cpp index a9cbc749..ec0abef7 100644 --- a/tests/beman/execution/exec-then.test.cpp +++ b/tests/beman/execution/exec-then.test.cpp @@ -36,7 +36,7 @@ struct get_value_t : test_std::forwarding_query_t { }; struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; auto set_error(auto&&) && noexcept -> void {} auto set_stopped() && noexcept -> void {} @@ -50,7 +50,7 @@ struct receiver { template struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template static consteval auto get_completion_signatures() -> completion_signatures { @@ -185,7 +185,7 @@ struct memory_env { auto query(const test_std::get_allocator_t&) const noexcept { return allocator; } }; struct memory_receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; std::pmr::polymorphic_allocator<> allocator; auto get_env() const noexcept { return memory_env{this->allocator}; } diff --git a/tests/beman/execution/exec-utils-cmplsigs.test.cpp b/tests/beman/execution/exec-utils-cmplsigs.test.cpp index 66f413e5..1961d8c1 100644 --- a/tests/beman/execution/exec-utils-cmplsigs.test.cpp +++ b/tests/beman/execution/exec-utils-cmplsigs.test.cpp @@ -37,7 +37,7 @@ template struct two_types {}; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using empty_signatures = test_std::completion_signatures struct multi_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template static consteval auto get_completion_signatures() -> completion_signatures { @@ -38,7 +38,7 @@ struct domain_sender { struct env { auto query(test_std::get_domain_t) const noexcept -> D { return {}; } }; - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template static consteval auto get_completion_signatures() -> completion_signatures { @@ -63,7 +63,7 @@ auto test_when_all_breathing() -> void { } struct await_cancel { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template static consteval auto get_completion_signatures() -> completion_signatures { @@ -72,7 +72,7 @@ struct await_cancel { template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; struct callback { Receiver* receiver; explicit callback(Receiver* rcvr) : receiver(rcvr) {} @@ -98,7 +98,7 @@ struct await_cancel { template struct test_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template static consteval auto get_completion_signatures() -> completion_signatures { @@ -107,7 +107,7 @@ struct test_sender { template struct upstream { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; const Result& expect; Receiver& receiver; auto set_error(auto&& error) && noexcept -> void { @@ -132,7 +132,7 @@ struct test_sender { }; template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; Result expect; std::remove_cvref_t receiver; decltype(test_std::connect(std::declval(), std::declval>())) inner_state; @@ -170,7 +170,7 @@ struct add_value_sig> { template struct add_value { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() noexcept { using signatures = decltype(test_std::get_completion_signatures()); diff --git a/tests/beman/execution/execution-module.test.cpp b/tests/beman/execution/execution-module.test.cpp index b11e998f..9a838bb8 100644 --- a/tests/beman/execution/execution-module.test.cpp +++ b/tests/beman/execution/execution-module.test.cpp @@ -63,11 +63,11 @@ TEST(execution_modules) { test::use_type(); // [exec.sched], schedulers - test::use_type(); + test::use_type(); static_assert(not test_std::scheduler); // [exec.recv], receivers - test::use_type(); + test::use_type(); static_assert(not test_std::receiver); static_assert(not test_std::receiver_of>); @@ -80,13 +80,13 @@ TEST(execution_modules) { test::use(test_std::set_stopped); // [exec.opstate], operation states - test::use_type(); + test::use_type(); static_assert(not test_std::operation_state); test::use_type(); test::use(test_std::start); // [exec.snd], senders - test::use_type(); + test::use_type(); static_assert(not test_std::sender); static_assert(not test_std::sender_in); //-dk:TODO static_assert(not test_std::sender_to); diff --git a/tests/beman/execution/execution-syn.test.cpp b/tests/beman/execution/execution-syn.test.cpp index d3711046..0bf117a1 100644 --- a/tests/beman/execution/execution-syn.test.cpp +++ b/tests/beman/execution/execution-syn.test.cpp @@ -39,10 +39,10 @@ struct scheduler { } }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; auto get_env() const noexcept -> env { return {}; } }; - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; auto schedule() const noexcept -> sender { return {}; } auto operator==(const scheduler&) const -> bool = default; @@ -53,7 +53,7 @@ struct no_value_env {}; struct single_type_sender { struct arg {}; struct error {}; - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using test_signatures = test_std::completion_signatures static consteval auto get_completion_signatures() { return test_std::completion_signatures static consteval auto get_completion_signatures() { @@ -104,7 +104,7 @@ struct no_value_sender { struct multi_single_sender { struct arg {}; struct error {}; - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template static consteval auto get_completion_signatures() { return test_std::completion_signatures static consteval auto get_completion_signatures() { return test_std::completion_signatures void { struct sender_in { struct arg {}; - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; template @@ -180,7 +180,7 @@ struct env {}; struct sender_with_get { struct arg {}; - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using empty_sigs = test_std::completion_signatures; using env_sigs = test_std::completion_signatures; @@ -277,10 +277,10 @@ auto test_single_sender() -> void { } struct connect_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; template struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; auto start() noexcept -> void {} }; struct tag {}; @@ -296,7 +296,7 @@ struct connect_sender { auto test_conect_result_t() -> void { struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; }; static_assert(test_std::sender); @@ -324,7 +324,7 @@ auto test_decays_to() -> void { template struct adapted_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; struct closure_t : test_std::sender_adaptor_closure { @@ -338,7 +338,7 @@ constexpr closure_t closure{}; auto test_sender_adaptor_closure() -> void { use(test_std::sender_adaptor_closure{}); struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; static_assert(test_std::sender); @@ -364,7 +364,7 @@ constexpr arg_closure_t arg_closure{}; auto test_sender_adaptor() -> void { struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; }; static_assert(test_std::sender); diff --git a/tests/beman/execution/include/test/completion_test.hpp b/tests/beman/execution/include/test/completion_test.hpp index 4866095e..ed1f241b 100644 --- a/tests/beman/execution/include/test/completion_test.hpp +++ b/tests/beman/execution/include/test/completion_test.hpp @@ -73,7 +73,7 @@ struct completion_test_receiver<::beman::execution::completion_signatures struct completion_test { - using sender_concept = ::beman::execution::sender_t; + using sender_concept = ::beman::execution::sender_tag; template static consteval auto get_completion_signatures() noexcept { return ::beman::execution::completion_signatures<::beman::execution::set_value_t()>(); @@ -81,12 +81,12 @@ struct completion_test { template <::beman::execution::receiver Receiver> struct state { - using operation_state_concept = ::beman::execution::operation_state_t; + using operation_state_concept = ::beman::execution::operation_state_tag; struct inner_receiver : test::completion_test_receiver< decltype(::beman::execution::get_completion_signatures>())> { - using receiver_concept = ::beman::execution::receiver_t; + using receiver_concept = ::beman::execution::receiver_tag; state* st; auto get_env() const noexcept -> ::beman::execution::env_of_t { return ::beman::execution::get_env(this->st->receiver); diff --git a/tests/beman/execution/include/test/optional_sender.hpp b/tests/beman/execution/include/test/optional_sender.hpp index 0a3bd920..e7719a03 100644 --- a/tests/beman/execution/include/test/optional_sender.hpp +++ b/tests/beman/execution/include/test/optional_sender.hpp @@ -24,7 +24,7 @@ import beman.execution; namespace test { template struct optional_sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; using completion_signatures = test_std::completion_signatures; optional_sender() = default; @@ -39,7 +39,7 @@ struct optional_sender { template Rcvr> auto connect(Rcvr rcvr) && noexcept -> auto { struct state { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; auto start() & noexcept -> void { test::use_type(); // make -Werror=unused-local-typedefs happy if (opt_) { diff --git a/tests/beman/execution/include/test/thread_pool.hpp b/tests/beman/execution/include/test/thread_pool.hpp index b9f505a6..7fa7a56f 100644 --- a/tests/beman/execution/include/test/thread_pool.hpp +++ b/tests/beman/execution/include/test/thread_pool.hpp @@ -72,7 +72,7 @@ struct test::thread_pool { } struct scheduler { - using scheduler_concept = test_std::scheduler_t; + using scheduler_concept = test_std::scheduler_tag; struct env { test::thread_pool* pool; @@ -83,7 +83,7 @@ struct test::thread_pool { }; template struct state final : test::thread_pool::node { - using operation_state_concept = test_std::operation_state_t; + using operation_state_concept = test_std::operation_state_tag; std::remove_cvref_t receiver; test::thread_pool* pool; @@ -99,7 +99,7 @@ struct test::thread_pool { void run() override { test_std::set_value(std::move(this->receiver)); } }; struct sender { - using sender_concept = test_std::sender_t; + using sender_concept = test_std::sender_tag; test::thread_pool* pool; template static consteval auto get_completion_signatures() diff --git a/tests/beman/execution/notify.test.cpp b/tests/beman/execution/notify.test.cpp index 9cd892d9..f0a298f1 100644 --- a/tests/beman/execution/notify.test.cpp +++ b/tests/beman/execution/notify.test.cpp @@ -26,7 +26,7 @@ TEST(notify) { } { struct receiver { - using receiver_concept = test_std::receiver_t; + using receiver_concept = test_std::receiver_tag; bool& result; auto set_value() && noexcept -> void { this->result = true; } }; From da13f3e00e457e4b92f16ed350c061b97d054a58 Mon Sep 17 00:00:00 2001 From: Cra3z <3324654761@qq.com> Date: Wed, 29 Apr 2026 22:55:12 +0800 Subject: [PATCH 2/2] Format code --- docs/code/tst-timer.hpp | 2 +- examples/intro-timer.hpp | 2 +- include/beman/execution/detail/spawn.hpp | 6 +++--- include/beman/execution/detail/spawn_future.hpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/code/tst-timer.hpp b/docs/code/tst-timer.hpp index 36afd60c..032388be 100644 --- a/docs/code/tst-timer.hpp +++ b/docs/code/tst-timer.hpp @@ -36,7 +36,7 @@ class tst::timer { template struct state { using operation_state_concept = tst::ex::operation_state_tag; - using scheduler_tag = decltype(ex::get_scheduler(ex::get_env(std::declval()))); + using scheduler_tag = decltype(ex::get_scheduler(ex::get_env(std::declval()))); struct execute { state* s{}; auto operator()() noexcept -> void { this->s->await_one(); } diff --git a/examples/intro-timer.hpp b/examples/intro-timer.hpp index 1413371c..acc79871 100644 --- a/examples/intro-timer.hpp +++ b/examples/intro-timer.hpp @@ -76,7 +76,7 @@ struct intro::timer { auto set_stopped() noexcept -> void { this->self->run_one(); } }; using operation_state_concept = ex::operation_state_tag; - using scheduler_tag = decltype(ex::get_delegation_scheduler(ex::get_env(std::declval()))); + using scheduler_tag = decltype(ex::get_delegation_scheduler(ex::get_env(std::declval()))); static_assert(ex::receiver); static_assert(ex::scheduler); static_assert(ex::sender()))>); diff --git a/include/beman/execution/detail/spawn.hpp b/include/beman/execution/detail/spawn.hpp index 239bc237..81be6a10 100644 --- a/include/beman/execution/detail/spawn.hpp +++ b/include/beman/execution/detail/spawn.hpp @@ -88,9 +88,9 @@ struct spawn_t { auto [all, senv] = ::beman::execution::detail::spawn_get_allocator(new_sender, env); using sender_tag = decltype(::beman::execution::write_env(::std::move(new_sender), senv)); - using state_t = state; - using alloc_t = typename ::std::allocator_traits::template rebind_alloc; - using traits_t = ::std::allocator_traits; + using state_t = state; + using alloc_t = typename ::std::allocator_traits::template rebind_alloc; + using traits_t = ::std::allocator_traits; alloc_t alloc(all); state_t* op{traits_t::allocate(alloc, 1u)}; traits_t::construct(alloc, op, all, ::beman::execution::write_env(::std::move(new_sender), senv), tok); diff --git a/include/beman/execution/detail/spawn_future.hpp b/include/beman/execution/detail/spawn_future.hpp index 5071b818..1adc1951 100644 --- a/include/beman/execution/detail/spawn_future.hpp +++ b/include/beman/execution/detail/spawn_future.hpp @@ -156,7 +156,7 @@ struct spawn_future_state using traits_t = ::std::allocator_traits; using spawned_sender_t = ::beman::execution::detail::future_spawned_sender; using sigs_t = ::beman::execution::detail::spawn_future_sigs; - using receiver_tag = ::beman::execution::detail::spawn_future_receiver; + using receiver_tag = ::beman::execution::detail::spawn_future_receiver; static_assert(::beman::execution::sender); static_assert(::beman::execution::receiver); using op_t = ::beman::execution::connect_result_t;