From b3af2597ae0b44ef0a1f158d567bea0116b5cac0 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Tue, 24 Feb 2026 16:59:16 -0800 Subject: [PATCH] move `completion_behavior` utils to `::exec::` --- include/exec/completion_behavior.hpp | 53 ++++++ include/exec/just_from.hpp | 5 +- include/exec/task.hpp | 1 + include/exec/thread_pool_base.hpp | 4 +- include/stdexec/__detail/__affine_on.hpp | 12 +- .../__detail/__completion_behavior.hpp | 159 +++++++++++------- include/stdexec/__detail/__continues_on.hpp | 8 +- include/stdexec/__detail/__deprecations.hpp | 4 +- include/stdexec/__detail/__execution_fwd.hpp | 4 +- .../stdexec/__detail/__inline_scheduler.hpp | 4 +- include/stdexec/__detail/__just.hpp | 4 +- include/stdexec/__detail/__let.hpp | 12 +- include/stdexec/__detail/__queries.hpp | 4 +- include/stdexec/__detail/__query.hpp | 2 +- include/stdexec/__detail/__read_env.hpp | 8 +- include/stdexec/__detail/__run_loop.hpp | 8 +- include/stdexec/__detail/__when_all.hpp | 14 +- test/test_common/senders.hpp | 21 +-- 18 files changed, 208 insertions(+), 119 deletions(-) create mode 100644 include/exec/completion_behavior.hpp diff --git a/include/exec/completion_behavior.hpp b/include/exec/completion_behavior.hpp new file mode 100644 index 000000000..79cd0053c --- /dev/null +++ b/include/exec/completion_behavior.hpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2026 NVIDIA Corporation + * + * Licensed under the Apache License Version 2.0 with LLVM Exceptions + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://llvm.org/LICENSE.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "../stdexec/__detail/__execution_fwd.hpp" + +// include these after __execution_fwd.hpp +#include "../stdexec/__detail/__completion_behavior.hpp" + +namespace experimental::execution +{ + struct completion_behavior + { + using unknown_t = STDEXEC::__completion_behavior::__unknown_t; + using asynchronous_t = STDEXEC::__completion_behavior::__asynchronous_t; + using asynchronous_affine_t = STDEXEC::__completion_behavior::__asynchronous_affine_t; + using inline_completion_t = STDEXEC::__completion_behavior::__inline_completion_t; + using weakest_t = STDEXEC::__completion_behavior::__weakest_t; + + static constexpr auto const &unknown = STDEXEC::__completion_behavior::__unknown; + static constexpr auto const &asynchronous = STDEXEC::__completion_behavior::__asynchronous; + static constexpr auto const &asynchronous_affine = + STDEXEC::__completion_behavior::__asynchronous_affine; + static constexpr auto const &inline_completion = + STDEXEC::__completion_behavior::__inline_completion; + static constexpr auto const &weakest = STDEXEC::__completion_behavior::__weakest; + }; + + template + using get_completion_behavior_t = STDEXEC::__get_completion_behavior_t<_Tag>; + + template + STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) + constexpr auto get_completion_behavior() noexcept + { + return STDEXEC::__get_completion_behavior<_Tag, _Sndr, _Env...>(); + } +} // namespace experimental::execution + +namespace exec = experimental::execution; diff --git a/include/exec/just_from.hpp b/include/exec/just_from.hpp index 231653ed2..953b0b5fc 100644 --- a/include/exec/just_from.hpp +++ b/include/exec/just_from.hpp @@ -17,6 +17,7 @@ #include "../stdexec/__detail/__meta.hpp" #include "../stdexec/execution.hpp" +#include "completion_behavior.hpp" namespace experimental::execution { @@ -128,9 +129,9 @@ namespace experimental::execution { template Tag> [[nodiscard]] - constexpr auto query(STDEXEC::get_completion_behavior_t) const noexcept + constexpr auto query(get_completion_behavior_t) const noexcept { - return STDEXEC::completion_behavior::inline_completion; + return completion_behavior::inline_completion; } }; diff --git a/include/exec/task.hpp b/include/exec/task.hpp index e1fcc7c41..3c566ba61 100644 --- a/include/exec/task.hpp +++ b/include/exec/task.hpp @@ -27,6 +27,7 @@ #include "any_sender_of.hpp" #include "at_coroutine_exit.hpp" +#include "completion_behavior.hpp" #include "scope.hpp" STDEXEC_PRAGMA_PUSH() diff --git a/include/exec/thread_pool_base.hpp b/include/exec/thread_pool_base.hpp index c19270fb1..3bf0f0ab7 100644 --- a/include/exec/thread_pool_base.hpp +++ b/include/exec/thread_pool_base.hpp @@ -475,9 +475,9 @@ namespace experimental::execution template Tag> [[nodiscard]] - constexpr auto query(STDEXEC::get_completion_behavior_t) const noexcept + constexpr auto query(STDEXEC::__get_completion_behavior_t) const noexcept { - return STDEXEC::completion_behavior::asynchronous; + return STDEXEC::__completion_behavior::__asynchronous; } [[nodiscard]] diff --git a/include/stdexec/__detail/__affine_on.hpp b/include/stdexec/__detail/__affine_on.hpp index 4e772eafc..b70ccbf42 100644 --- a/include/stdexec/__detail/__affine_on.hpp +++ b/include/stdexec/__detail/__affine_on.hpp @@ -33,11 +33,11 @@ namespace STDEXEC { // For a given completion tag, a sender is "already affine" if either it doesn't send // that tag, or if its completion behavior for that tag is already "inline" or - // "asynchronous_affine". + // "__asynchronous_affine". template concept __already_affine = (!__sends<_Tag, _Sender, _Env>) - || (get_completion_behavior<_Tag, _Sender, _Env>() - >= completion_behavior::asynchronous_affine); + || (__get_completion_behavior<_Tag, _Sender, _Env>() + >= __completion_behavior::__asynchronous_affine); // For the purpose of the affine_on algorithm, a sender that is "already affine" for // all three of the standard completion tags does not need to be adapted to become @@ -119,11 +119,11 @@ namespace STDEXEC struct __attrs { template - constexpr auto query(get_completion_behavior_t<_Tag>) const noexcept + constexpr auto query(__get_completion_behavior_t<_Tag>) const noexcept { // FUTURE: when the child sender completes inline *and* the current scheduler also - // completes inline, we can return "inline" here instead of "asynchronous_affine". - return completion_behavior::asynchronous_affine; + // completes inline, we can return "inline" here instead of "__asynchronous_affine". + return __completion_behavior::__asynchronous_affine; } }; } // namespace __affine_on diff --git a/include/stdexec/__detail/__completion_behavior.hpp b/include/stdexec/__detail/__completion_behavior.hpp index ddee61cb3..18c561308 100644 --- a/include/stdexec/__detail/__completion_behavior.hpp +++ b/include/stdexec/__detail/__completion_behavior.hpp @@ -29,123 +29,119 @@ namespace STDEXEC { ////////////////////////////////////////////////////////////////////////////////////////// - // get_completion_behavior - struct completion_behavior + // __get_completion_behavior + struct __completion_behavior { - enum class behavior : int + enum class __behavior : int { - unknown, ///< The completion behavior is unknown. - asynchronous, ///< The operation's completion will not always happen on the calling thread before `start()` - ///< returns. - asynchronous_affine, ///< Like asynchronous, but completes where it starts. - inline_completion ///< The operation completes synchronously within `start()` on the same thread that called - ///< `start()`. + __unknown, ///< The completion behavior is unknown. + __asynchronous, ///< The operation's completion will not always happen on + ///< the calling thread before `start()` returns. + __asynchronous_affine, ///< Like asynchronous, but completes where it starts. + __inline_completion ///< The operation completes synchronously within `start()` + ///< on the same thread that called `start()`. }; STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - friend constexpr auto operator<=>(behavior __a, behavior __b) noexcept -> std::strong_ordering + friend constexpr auto + operator<=>(__behavior __a, __behavior __b) noexcept -> std::strong_ordering { return static_cast(__a) <=> static_cast(__b); } private: - template - using __constant_t = std::integral_constant; - - using __unknown_t = __constant_t; - using __asynchronous_t = __constant_t; - using __asynchronous_affine_t = __constant_t; - using __inline_completion_t = __constant_t; + template <__behavior _CB> + using __constant_t = std::integral_constant<__behavior, _CB>; public: - struct unknown_t : __unknown_t - {}; - struct asynchronous_t : __asynchronous_t - {}; - struct asynchronous_affine_t : __asynchronous_affine_t - {}; - struct inline_completion_t : __inline_completion_t - {}; - - static constexpr unknown_t unknown{}; - static constexpr asynchronous_t asynchronous{}; - static constexpr asynchronous_affine_t asynchronous_affine{}; - static constexpr inline_completion_t inline_completion{}; - - struct weakest_t + struct __unknown_t : __constant_t<__behavior::__unknown> + { }; + struct __asynchronous_t : __constant_t<__behavior::__asynchronous> + { }; + struct __asynchronous_affine_t : __constant_t<__behavior::__asynchronous_affine> + { }; + struct __inline_completion_t : __constant_t<__behavior::__inline_completion> + { }; + + static constexpr __unknown_t __unknown{}; + static constexpr __asynchronous_t __asynchronous{}; + static constexpr __asynchronous_affine_t __asynchronous_affine{}; + static constexpr __inline_completion_t __inline_completion{}; + + struct __weakest_t { - template + template <__behavior... _CBs> STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - constexpr auto operator()(completion_behavior::__constant_t<_CBs>...) const noexcept + constexpr auto operator()(__completion_behavior::__constant_t<_CBs>...) const noexcept { - constexpr auto __behavior = static_cast( + constexpr auto __behavior = static_cast<__completion_behavior::__behavior>( STDEXEC::__umin({static_cast(_CBs)...})); - if constexpr (__behavior == completion_behavior::unknown) + if constexpr (__behavior == __completion_behavior::__unknown) { - return completion_behavior::unknown; + return __completion_behavior::__unknown; } - else if constexpr (__behavior == completion_behavior::asynchronous) + else if constexpr (__behavior == __completion_behavior::__asynchronous) { - return completion_behavior::asynchronous; + return __completion_behavior::__asynchronous; } - else if constexpr (__behavior == completion_behavior::asynchronous_affine) + else if constexpr (__behavior == __completion_behavior::__asynchronous_affine) { - return completion_behavior::asynchronous_affine; + return __completion_behavior::__asynchronous_affine; } - else if constexpr (__behavior == completion_behavior::inline_completion) + else if constexpr (__behavior == __completion_behavior::__inline_completion) { - return completion_behavior::inline_completion; + return __completion_behavior::__inline_completion; } STDEXEC_UNREACHABLE(); } }; - static constexpr weakest_t weakest{}; + static constexpr __weakest_t __weakest{}; }; ////////////////////////////////////////////////////////////////////////////////////////// - // get_completion_behavior: A sender can define this attribute to describe the sender's + // __get_completion_behavior: A sender can define this attribute to describe the sender's // completion behavior template <__completion_tag _Tag> - struct get_completion_behavior_t + struct __get_completion_behavior_t { private: template STDEXEC_ATTRIBUTE(always_inline, host, device) static constexpr auto __validate() noexcept { - using __result_t = __member_query_result_t<_Attrs, get_completion_behavior_t, _Env...>; - static_assert(__nothrow_member_queryable_with<_Attrs, get_completion_behavior_t, _Env...>, - "The get_completion_behavior query must be noexcept."); - static_assert(__std::convertible_to<__result_t, completion_behavior::behavior>, - "The get_completion_behavior query must return one of the static member " + using __result_t = __member_query_result_t<_Attrs, __get_completion_behavior_t, _Env...>; + static_assert(__nothrow_member_queryable_with<_Attrs, __get_completion_behavior_t, _Env...>, + "The __get_completion_behavior query must be noexcept."); + static_assert(__std::convertible_to<__result_t, __completion_behavior::__behavior>, + "The __get_completion_behavior query must return one of the static member " "variables in " - "execution::completion_behavior."); + "execution::__completion_behavior."); return __result_t{}; } public: template - inline static constexpr get_completion_behavior_t (*signature)(_Sig) = nullptr; + inline static constexpr __get_completion_behavior_t (*signature)(_Sig) = nullptr; template STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) constexpr auto operator()(_Attrs const &, _Env const &...) const noexcept { if constexpr (__member_queryable_with<_Attrs const &, - get_completion_behavior_t<_Tag>, + __get_completion_behavior_t<_Tag>, _Env...>) { return __validate<_Attrs, _Env...>(); } - else if constexpr (__member_queryable_with<_Attrs const &, get_completion_behavior_t<_Tag>>) + else if constexpr (__member_queryable_with<_Attrs const &, __get_completion_behavior_t<_Tag>>) { return __validate<_Attrs>(); } else { - return completion_behavior::unknown; + return __completion_behavior::__unknown; } } @@ -157,24 +153,61 @@ namespace STDEXEC }; template - using __common_completion_behavior_t = __result_of; + using __common_completion_behavior_t = __result_of<__completion_behavior::__weakest, _CBs...>; template concept __completes_inline = - (__call_result_t, _Attrs const &, _Env const &...>{} - == completion_behavior::inline_completion); + (__call_result_t<__get_completion_behavior_t<_Tag>, _Attrs const &, _Env const &...>{} + == __completion_behavior::__inline_completion); template concept __completes_where_it_starts = - (__call_result_t, _Attrs const &, _Env const &...>{} - >= completion_behavior::asynchronous_affine); + (__call_result_t<__get_completion_behavior_t<_Tag>, _Attrs const &, _Env const &...>{} + >= __completion_behavior::__asynchronous_affine); template STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - constexpr auto get_completion_behavior() noexcept + constexpr auto __get_completion_behavior() noexcept { using __behavior_t = - __call_result_t, env_of_t<_Sndr>, _Env const &...>; + __call_result_t<__get_completion_behavior_t<_Tag>, env_of_t<_Sndr>, _Env const &...>; return __behavior_t{}; } + +#if !defined(STDEXEC_DOXYGEN_INVOKED) + + struct [[deprecated("Use exec::completion_behavior from " + " instead")]] completion_behavior + { + using unknown_t = __completion_behavior::__unknown_t; + using asynchronous_t = __completion_behavior::__asynchronous_t; + using asynchronous_affine_t = __completion_behavior::__asynchronous_affine_t; + using inline_completion_t = __completion_behavior::__inline_completion_t; + using weakest_t = __completion_behavior::__weakest_t; + + static constexpr auto const &unknown = __completion_behavior::__unknown; + static constexpr auto const &asynchronous = __completion_behavior::__asynchronous; + static constexpr auto const &asynchronous_affine = __completion_behavior::__asynchronous_affine; + static constexpr auto const &inline_completion = __completion_behavior::__inline_completion; + static constexpr auto const &weakest = __completion_behavior::__weakest; + }; + + template <__completion_tag _Tag> + using get_completion_behavior_t [[deprecated("Use exec::get_completion_behavior from " + " instead")]] + = __get_completion_behavior_t<_Tag>; + + // clang-format off + template + [[deprecated("Use exec::get_completion_behavior from " + "instead")]] + STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) + constexpr auto get_completion_behavior() noexcept + { + return __get_completion_behavior<_Tag, _Sndr, _Env...>(); + } + // clang-format on + +#endif // !defined(STDEXEC_DOXYGEN_INVOKED) + } // namespace STDEXEC diff --git a/include/stdexec/__detail/__continues_on.hpp b/include/stdexec/__detail/__continues_on.hpp index 4b1652d9b..656e71e3c 100644 --- a/include/stdexec/__detail/__continues_on.hpp +++ b/include/stdexec/__detail/__continues_on.hpp @@ -284,14 +284,14 @@ namespace STDEXEC //! the original sender. template [[nodiscard]] - constexpr auto query(get_completion_behavior_t<_Tag>, _Env const &...) const noexcept + constexpr auto query(__get_completion_behavior_t<_Tag>, _Env const &...) const noexcept { using _SchSender = schedule_result_t<_Scheduler>; constexpr auto cb_sched = - STDEXEC::get_completion_behavior<_Tag, _SchSender, __fwd_env_t<_Env>...>(); + STDEXEC::__get_completion_behavior<_Tag, _SchSender, __fwd_env_t<_Env>...>(); constexpr auto cb_sndr = - STDEXEC::get_completion_behavior<_Tag, _Sender, __fwd_env_t<_Env>...>(); - return completion_behavior::weakest(cb_sched, cb_sndr); + STDEXEC::__get_completion_behavior<_Tag, _Sender, __fwd_env_t<_Env>...>(); + return __completion_behavior::__weakest(cb_sched, cb_sndr); } //! @brief Forwards other queries to the underlying sender's environment. diff --git a/include/stdexec/__detail/__deprecations.hpp b/include/stdexec/__detail/__deprecations.hpp index afbe0a8c4..529b963e4 100644 --- a/include/stdexec/__detail/__deprecations.hpp +++ b/include/stdexec/__detail/__deprecations.hpp @@ -25,8 +25,8 @@ namespace STDEXEC inline constexpr __execute_may_block_caller_t const & execute_may_block_caller = __execute_may_block_caller; - [[deprecated("use STDEXEC::completion_behavior::weakest instead")]] - inline constexpr auto const & min = completion_behavior::weakest; + [[deprecated("use STDEXEC::__completion_behavior::__weakest instead")]] + inline constexpr auto const & min = __completion_behavior::__weakest; using empty_env [[deprecated("STDEXEC::empty_env is now spelled STDEXEC::env<>")]] = env<>; diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index 9884865b7..df95853d8 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -115,7 +115,7 @@ namespace STDEXEC template struct get_completion_domain_t; template <__completion_tag _CPO> - struct get_completion_behavior_t; + struct __get_completion_behavior_t; struct get_domain_t; struct get_await_completion_adaptor_t; @@ -150,7 +150,7 @@ namespace STDEXEC template STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - constexpr auto get_completion_behavior() noexcept; + constexpr auto __get_completion_behavior() noexcept; template using __domain_of_t = __decay_t<__call_result_t>; diff --git a/include/stdexec/__detail/__inline_scheduler.hpp b/include/stdexec/__detail/__inline_scheduler.hpp index ca70dbfed..6f4540cba 100644 --- a/include/stdexec/__detail/__inline_scheduler.hpp +++ b/include/stdexec/__detail/__inline_scheduler.hpp @@ -27,9 +27,9 @@ namespace STDEXEC struct __inline_attrs { STDEXEC_ATTRIBUTE(nodiscard, host, device) - constexpr auto query(get_completion_behavior_t) const noexcept + constexpr auto query(__get_completion_behavior_t) const noexcept { - return completion_behavior::inline_completion; + return __completion_behavior::__inline_completion; } constexpr auto operator==(__inline_attrs const &) const noexcept -> bool = default; }; diff --git a/include/stdexec/__detail/__just.hpp b/include/stdexec/__detail/__just.hpp index 945f13bb8..6ff783a73 100644 --- a/include/stdexec/__detail/__just.hpp +++ b/include/stdexec/__detail/__just.hpp @@ -37,9 +37,9 @@ namespace STDEXEC template struct __attrs { - static constexpr auto query(get_completion_behavior_t<_SetTag>) noexcept + static constexpr auto query(__get_completion_behavior_t<_SetTag>) noexcept { - return completion_behavior::inline_completion; + return __completion_behavior::__inline_completion; } }; diff --git a/include/stdexec/__detail/__let.hpp b/include/stdexec/__detail/__let.hpp index 44842f839..8404dfb96 100644 --- a/include/stdexec/__detail/__let.hpp +++ b/include/stdexec/__detail/__let.hpp @@ -500,11 +500,11 @@ namespace STDEXEC if constexpr (__minvocable<__result_sender_fn, _Ts...>) { using __sndr2_t = __mcall<__result_sender_fn, _Ts...>; - return STDEXEC::get_completion_behavior<_SetTag, __sndr2_t, _JoinEnv2...>(); + return STDEXEC::__get_completion_behavior<_SetTag, __sndr2_t, _JoinEnv2...>(); } else { - return completion_behavior::unknown; + return __completion_behavior::__unknown; } } @@ -596,7 +596,7 @@ namespace STDEXEC template [[nodiscard]] - constexpr auto query(get_completion_behavior_t<__set_tag_t>, _Env const &...) const noexcept + constexpr auto query(__get_completion_behavior_t<__set_tag_t>, _Env const &...) const noexcept { if constexpr (sender_in<_Sndr, __fwd_env_t<_Env>...>) { @@ -610,18 +610,18 @@ namespace STDEXEC using __completions_t = __completion_signatures_of_t<_Sndr, __fwd_env_t<_Env>...>; constexpr auto __pred_behavior = - STDEXEC::get_completion_behavior<__set_tag_t, _Sndr, __fwd_env_t<_Env>...>(); + STDEXEC::__get_completion_behavior<__set_tag_t, _Sndr, __fwd_env_t<_Env>...>(); constexpr auto __result_behavior = __gather_completions_t<__set_tag_t, __completions_t, __transform_fn, __qq<__common_completion_behavior_t>>(); - return completion_behavior::weakest(__pred_behavior, __result_behavior); + return __completion_behavior::__weakest(__pred_behavior, __result_behavior); } else { - return completion_behavior::unknown; + return __completion_behavior::__unknown; } } }; diff --git a/include/stdexec/__detail/__queries.hpp b/include/stdexec/__detail/__queries.hpp index 7a97aa082..77942078d 100644 --- a/include/stdexec/__detail/__queries.hpp +++ b/include/stdexec/__detail/__queries.hpp @@ -130,9 +130,9 @@ namespace STDEXEC template [[nodiscard]] - constexpr auto query(get_completion_behavior_t<_Tag>, _Env const &...) const noexcept + constexpr auto query(__get_completion_behavior_t<_Tag>, _Env const &...) const noexcept { - return get_completion_behavior<_Tag, _Sender, _Env...>(); + return __get_completion_behavior<_Tag, _Sender, _Env...>(); } template <__forwarding_query _Query, class... _Args> diff --git a/include/stdexec/__detail/__query.hpp b/include/stdexec/__detail/__query.hpp index d33c559ac..9a50df70f 100644 --- a/include/stdexec/__detail/__query.hpp +++ b/include/stdexec/__detail/__query.hpp @@ -145,7 +145,7 @@ namespace STDEXEC template inline constexpr bool __is_completion_query> = true; template - inline constexpr bool __is_completion_query> = true; + inline constexpr bool __is_completion_query<__get_completion_behavior_t<_Tag>> = true; } // namespace STDEXEC STDEXEC_P2300_NAMESPACE_BEGIN() diff --git a/include/stdexec/__detail/__read_env.hpp b/include/stdexec/__detail/__read_env.hpp index 69836f473..837fa3b4e 100644 --- a/include/stdexec/__detail/__read_env.hpp +++ b/include/stdexec/__detail/__read_env.hpp @@ -81,17 +81,17 @@ namespace STDEXEC template requires __callable<_Query, _Env> STDEXEC_ATTRIBUTE(nodiscard) - constexpr auto query(get_completion_behavior_t, _Env const &) const noexcept + constexpr auto query(__get_completion_behavior_t, _Env const &) const noexcept { - return completion_behavior::inline_completion; + return __completion_behavior::__inline_completion; } template requires __callable<_Query, _Env> && (!__nothrow_callable<_Query, _Env>) STDEXEC_ATTRIBUTE(nodiscard) - constexpr auto query(get_completion_behavior_t, _Env const &) const noexcept + constexpr auto query(__get_completion_behavior_t, _Env const &) const noexcept { - return completion_behavior::inline_completion; + return __completion_behavior::__inline_completion; } }; diff --git a/include/stdexec/__detail/__run_loop.hpp b/include/stdexec/__detail/__run_loop.hpp index 223b79d32..36dc3e325 100644 --- a/include/stdexec/__detail/__run_loop.hpp +++ b/include/stdexec/__detail/__run_loop.hpp @@ -207,14 +207,14 @@ namespace STDEXEC constexpr auto query(get_completion_domain_t) const noexcept; STDEXEC_ATTRIBUTE(nodiscard, host, device) - constexpr auto query(get_completion_behavior_t) const noexcept + constexpr auto query(__get_completion_behavior_t) const noexcept { - return completion_behavior::asynchronous; + return __completion_behavior::__asynchronous; } STDEXEC_ATTRIBUTE(nodiscard, host, device) - constexpr auto query(get_completion_behavior_t) const noexcept + constexpr auto query(__get_completion_behavior_t) const noexcept { - return completion_behavior::asynchronous; + return __completion_behavior::__asynchronous; } STDEXEC_ATTRIBUTE(nodiscard, host, device) diff --git a/include/stdexec/__detail/__when_all.hpp b/include/stdexec/__detail/__when_all.hpp index 08c455e59..0dcb0f8c5 100644 --- a/include/stdexec/__detail/__when_all.hpp +++ b/include/stdexec/__detail/__when_all.hpp @@ -365,10 +365,10 @@ namespace STDEXEC template [[nodiscard]] - constexpr auto query(get_completion_behavior_t<_Tag>, _Env const &...) const noexcept + constexpr auto query(__get_completion_behavior_t<_Tag>, _Env const &...) const noexcept { - return completion_behavior::weakest( - STDEXEC::get_completion_behavior<_Tag, _Senders, _Env...>()...); + return __completion_behavior::__weakest( + STDEXEC::__get_completion_behavior<_Tag, _Senders, _Env...>()...); } }; @@ -377,15 +377,15 @@ namespace STDEXEC struct __attrs<> { [[nodiscard]] - constexpr auto query(get_completion_behavior_t) const noexcept + constexpr auto query(__get_completion_behavior_t) const noexcept { - return completion_behavior::inline_completion; + return __completion_behavior::__inline_completion; } [[nodiscard]] - constexpr auto query(get_completion_behavior_t) const noexcept + constexpr auto query(__get_completion_behavior_t) const noexcept { - return completion_behavior::inline_completion; + return __completion_behavior::__inline_completion; } }; diff --git a/test/test_common/senders.hpp b/test/test_common/senders.hpp index 233d053fc..4d89c870a 100644 --- a/test/test_common/senders.hpp +++ b/test/test_common/senders.hpp @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include #include @@ -47,7 +48,7 @@ namespace template struct fallible_just { - using sender_concept = STDEXEC::sender_t; + using sender_concept = ex::sender_t; explicit fallible_just(Values... values) : values_(std::move(values)...) @@ -76,14 +77,14 @@ namespace struct attrs { [[nodiscard]] - auto query(ex::get_completion_behavior_t) const noexcept + auto query(ex::__get_completion_behavior_t) const noexcept { - return ex::completion_behavior::inline_completion; + return ex::__completion_behavior::__inline_completion; } [[nodiscard]] - auto query(ex::get_completion_behavior_t) const noexcept + auto query(ex::__get_completion_behavior_t) const noexcept { - return ex::completion_behavior::inline_completion; + return ex::__completion_behavior::__inline_completion; } }; @@ -132,7 +133,7 @@ namespace { std::remove_cvref_t env_; std::tuple values_; - using sender_concept = STDEXEC::sender_t; + using sender_concept = ex::sender_t; using completion_signatures = ex::completion_signatures; template @@ -162,7 +163,7 @@ namespace struct completes_if { - using sender_concept = STDEXEC::sender_t; + using sender_concept = ex::sender_t; using completion_signatures = ex::completion_signatures; bool condition_; @@ -202,7 +203,7 @@ namespace }; using callback_t = - ex::stop_token_of_t&>::template callback_type; + ex::stop_callback_for_t&>, on_stopped>; std::optional on_stop_{}; void start() & noexcept @@ -324,9 +325,9 @@ namespace struct attrs { [[nodiscard]] - static constexpr auto query(ex::get_completion_behavior_t) noexcept + static constexpr auto query(exec::get_completion_behavior_t) noexcept { - return ex::completion_behavior::inline_completion; + return exec::completion_behavior::inline_completion; } };