From 3594a5fb5ec229cda07906fd035775e6b95e071e Mon Sep 17 00:00:00 2001 From: Ben FrantzDale Date: Tue, 8 Oct 2024 08:54:13 -0400 Subject: [PATCH] deprecate get_delegatee_scheduler in favor of get_delegation_schduler (P2300R10). --- include/nvexec/stream/sync_wait.cuh | 2 +- include/stdexec/__detail/__env.hpp | 22 ++++++++++++------- include/stdexec/__detail/__execution_fwd.hpp | 6 ++--- include/stdexec/__detail/__read_env.hpp | 4 ++-- include/stdexec/__detail/__schedulers.hpp | 12 +++++----- include/stdexec/__detail/__sync_wait.hpp | 4 ++-- .../queries/test_forwarding_queries.cpp | 5 ++++- 7 files changed, 32 insertions(+), 23 deletions(-) diff --git a/include/nvexec/stream/sync_wait.cuh b/include/nvexec/stream/sync_wait.cuh index 84458ffb7..eea5ce769 100644 --- a/include/nvexec/stream/sync_wait.cuh +++ b/include/nvexec/stream/sync_wait.cuh @@ -31,7 +31,7 @@ namespace nvexec::STDEXEC_STREAM_DETAIL_NS { namespace _sync_wait { return __sched_; } - auto query(get_delegatee_scheduler_t) const noexcept -> run_loop::__scheduler { + auto query(get_delegation_scheduler_t) const noexcept -> run_loop::__scheduler { return __sched_; } }; diff --git a/include/stdexec/__detail/__env.hpp b/include/stdexec/__detail/__env.hpp index ee8d08a5a..da134ef36 100644 --- a/include/stdexec/__detail/__env.hpp +++ b/include/stdexec/__detail/__env.hpp @@ -151,17 +151,17 @@ namespace stdexec { auto operator()() const noexcept; }; - struct get_delegatee_scheduler_t : __query { + struct get_delegation_scheduler_t : __query { static constexpr auto query(forwarding_query_t) noexcept -> bool { return true; } template - requires tag_invocable + requires tag_invocable auto operator()(const _Env& __t) const noexcept - -> tag_invoke_result_t; + -> tag_invoke_result_t; - template + template auto operator()() const noexcept; }; @@ -289,7 +289,10 @@ namespace stdexec { using __queries::get_forward_progress_guarantee_t; using __queries::get_allocator_t; using __queries::get_scheduler_t; - using __queries::get_delegatee_scheduler_t; + using __queries::get_delegation_scheduler_t; + using get_delegatee_scheduler_t + [[deprecated("get_delegatee_scheduler_t has been renamed get_delegation_scheduler_t")]] = + get_delegation_scheduler_t; using __queries::get_stop_token_t; using __queries::get_completion_scheduler_t; using __queries::get_domain_t; @@ -303,7 +306,10 @@ namespace stdexec { inline constexpr __has_algorithm_customizations_t __has_algorithm_customizations{}; inline constexpr get_forward_progress_guarantee_t get_forward_progress_guarantee{}; inline constexpr get_scheduler_t get_scheduler{}; - inline constexpr get_delegatee_scheduler_t get_delegatee_scheduler{}; + inline constexpr get_delegation_scheduler_t get_delegation_scheduler{}; + inline constexpr auto& get_delegatee_scheduler + [[deprecated("get_delegatee_scheduler has been renamed get_delegation_scheduler")]] = + get_delegation_scheduler; inline constexpr get_allocator_t get_allocator{}; inline constexpr get_stop_token_t get_stop_token{}; #if !STDEXEC_GCC() || defined(__OPTIMIZE_SIZE__) @@ -577,8 +583,8 @@ namespace stdexec { template requires __callable - auto query(_Tag) const - noexcept(__nothrow_callable) -> __call_result_t { + auto query(_Tag) const noexcept(__nothrow_callable) + -> __call_result_t { return __fun_(_Tag()); } diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index 774eea480..78a653774 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -84,7 +84,7 @@ namespace stdexec { struct get_forward_progress_guarantee_t; struct __has_algorithm_customizations_t; struct get_scheduler_t; - struct get_delegatee_scheduler_t; + struct get_delegation_scheduler_t; struct get_allocator_t; struct get_stop_token_t; template <__completion_tag _CPO> @@ -97,7 +97,7 @@ namespace stdexec { using __queries::get_forward_progress_guarantee_t; using __queries::get_allocator_t; using __queries::get_scheduler_t; - using __queries::get_delegatee_scheduler_t; + using __queries::get_delegation_scheduler_t; using __queries::get_stop_token_t; using __queries::get_completion_scheduler_t; @@ -106,7 +106,7 @@ namespace stdexec { extern const __has_algorithm_customizations_t __has_algorithm_customizations; extern const get_forward_progress_guarantee_t get_forward_progress_guarantee; extern const get_scheduler_t get_scheduler; - extern const get_delegatee_scheduler_t get_delegatee_scheduler; + extern const get_delegation_scheduler_t get_delegation_scheduler; extern const get_allocator_t get_allocator; extern const get_stop_token_t get_stop_token; template <__completion_tag _CPO> diff --git a/include/stdexec/__detail/__read_env.hpp b/include/stdexec/__detail/__read_env.hpp index b871b0abd..854a8c2e3 100644 --- a/include/stdexec/__detail/__read_env.hpp +++ b/include/stdexec/__detail/__read_env.hpp @@ -132,8 +132,8 @@ namespace stdexec { } template - inline auto get_delegatee_scheduler_t::operator()() const noexcept { - return read_env(get_delegatee_scheduler); + inline auto get_delegation_scheduler_t::operator()() const noexcept { + return read_env(get_delegation_scheduler); } template diff --git a/include/stdexec/__detail/__schedulers.hpp b/include/stdexec/__detail/__schedulers.hpp index 8f429760f..d8adb311b 100644 --- a/include/stdexec/__detail/__schedulers.hpp +++ b/include/stdexec/__detail/__schedulers.hpp @@ -101,12 +101,12 @@ namespace stdexec { } template - requires tag_invocable - inline auto get_delegatee_scheduler_t::operator()(const _Env& __env) const noexcept - -> tag_invoke_result_t { - static_assert(nothrow_tag_invocable); - static_assert(scheduler>); - return tag_invoke(get_delegatee_scheduler_t{}, __env); + requires tag_invocable + inline auto get_delegation_scheduler_t::operator()(const _Env& __env) const noexcept + -> tag_invoke_result_t { + static_assert(nothrow_tag_invocable); + static_assert(scheduler>); + return tag_invoke(get_delegation_scheduler_t{}, __env); } template <__completion_tag _Tag> diff --git a/include/stdexec/__detail/__sync_wait.hpp b/include/stdexec/__detail/__sync_wait.hpp index f5d9725ad..0693c9742 100644 --- a/include/stdexec/__detail/__sync_wait.hpp +++ b/include/stdexec/__detail/__sync_wait.hpp @@ -51,7 +51,7 @@ namespace stdexec { return __loop_->get_scheduler(); } - auto query(get_delegatee_scheduler_t) const noexcept -> run_loop::__scheduler { + auto query(get_delegation_scheduler_t) const noexcept -> run_loop::__scheduler { return __loop_->get_scheduler(); } @@ -238,7 +238,7 @@ namespace stdexec { /// `sync_wait` connects and starts the given sender, and then drives a /// `run_loop` instance until the sender completes. Additional work /// can be delegated to the `run_loop` by scheduling work on the - /// scheduler returned by calling `get_delegatee_scheduler` on the + /// scheduler returned by calling `get_delegation_scheduler` on the /// receiver's environment. /// /// @pre The sender must have a exactly one value completion signature. That diff --git a/test/stdexec/queries/test_forwarding_queries.cpp b/test/stdexec/queries/test_forwarding_queries.cpp index 9e97f6be5..f872e8ce5 100644 --- a/test/stdexec/queries/test_forwarding_queries.cpp +++ b/test/stdexec/queries/test_forwarding_queries.cpp @@ -39,7 +39,10 @@ namespace { static_assert(ex::forwarding_query(ex::get_allocator)); static_assert(ex::forwarding_query(ex::get_stop_token)); static_assert(ex::forwarding_query(ex::get_scheduler)); - static_assert(ex::forwarding_query(ex::get_delegatee_scheduler)); + static_assert(ex::forwarding_query(ex::get_delegation_scheduler)); + static_assert(std::is_same_v, + "Deprecated type is the same type."); + static_assert(&ex::get_delegatee_scheduler == &ex::get_delegation_scheduler); static_assert(ex::forwarding_query(ex::get_completion_scheduler)); static_assert(ex::forwarding_query(ex::get_completion_scheduler)); static_assert(ex::forwarding_query(ex::get_completion_scheduler));