From e69f728d38971ac7a016d81be9057449e152ac93 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Sun, 5 Apr 2026 15:24:58 -0700 Subject: [PATCH] rename `affine_on` to `affine` per wg21 --- .../{__affine_on.hpp => __affine.hpp} | 30 +++++++++---------- include/stdexec/__detail/__deprecations.hpp | 4 +++ include/stdexec/__detail/__execution_fwd.hpp | 4 +-- include/stdexec/__detail/__task.hpp | 4 +-- 4 files changed, 23 insertions(+), 19 deletions(-) rename include/stdexec/__detail/{__affine_on.hpp => __affine.hpp} (89%) diff --git a/include/stdexec/__detail/__affine_on.hpp b/include/stdexec/__detail/__affine.hpp similarity index 89% rename from include/stdexec/__detail/__affine_on.hpp rename to include/stdexec/__detail/__affine.hpp index 9ebd1140d..a4b63a0d0 100644 --- a/include/stdexec/__detail/__affine_on.hpp +++ b/include/stdexec/__detail/__affine.hpp @@ -27,7 +27,7 @@ namespace STDEXEC struct _CANNOT_MAKE_SENDER_AFFINE_TO_THE_STARTING_SCHEDULER_; struct _THE_SCHEDULER_IN_THE_CURRENT_EXECUTION_ENVIRONMENT_IS_NOT_INFALLIBLE_; - namespace __affine_on + namespace __affine { // 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 @@ -37,21 +37,21 @@ namespace STDEXEC || __completion_behavior::__is_affine( __get_completion_behavior<_Tag, _Sender, _Env>()); - // For the purpose of the affine_on algorithm, a sender that is "already affine" for + // For the purpose of the affine algorithm, a sender that is "already affine" for // all three of the standard completion tags does not need to be adapted to become // affine. template concept __is_affine = __already_affine && __already_affine && __already_affine; - } // namespace __affine_on + } // namespace __affine - struct affine_on_t + struct affine_t { template constexpr auto operator()(_Sender &&__sndr) const -> __well_formed_sender auto { - return __make_sexpr({}, static_cast<_Sender &&>(__sndr)); + return __make_sexpr({}, static_cast<_Sender &&>(__sndr)); } constexpr auto operator()() const noexcept @@ -62,7 +62,7 @@ namespace STDEXEC template static constexpr auto transform_sender(set_value_t, _Sender &&__sndr, _Env const &__env) { - static_assert(__sender_for<_Sender, affine_on_t>); + static_assert(__sender_for<_Sender, affine_t>); auto &[__tag, __ign, __child] = __sndr; using __child_t = decltype(__child); using __cv_child_t = __copy_cvref_t<_Sender, __child_t>; @@ -76,7 +76,7 @@ namespace STDEXEC // compile-time error when the child sender is used. return STDEXEC::__forward_like<_Sender>(__child); } - else if constexpr (__affine_on::__is_affine<__cv_child_t, _Env>) + else if constexpr (__affine::__is_affine<__cv_child_t, _Env>) { // Check the child's completion behavior. If it is "inline" or "async_affine", then // we can just return the child sender. Otherwise, we need to wrap it. @@ -89,7 +89,7 @@ namespace STDEXEC return __not_a_sender< // _WHAT_(_CANNOT_MAKE_SENDER_AFFINE_TO_THE_STARTING_SCHEDULER_), _WHY_(_THE_CURRENT_EXECUTION_ENVIRONMENT_DOESNT_HAVE_A_SCHEDULER_), - _WHERE_(_IN_ALGORITHM_, affine_on_t), + _WHERE_(_IN_ALGORITHM_, affine_t), _WITH_PRETTY_SENDER_<__cv_child_t>, _WITH_ENVIRONMENT_(_Env)>{}; } @@ -100,7 +100,7 @@ namespace STDEXEC return __not_a_sender< _WHAT_(_CANNOT_MAKE_SENDER_AFFINE_TO_THE_STARTING_SCHEDULER_), _WHY_(_THE_SCHEDULER_IN_THE_CURRENT_EXECUTION_ENVIRONMENT_IS_NOT_INFALLIBLE_), - _WHERE_(_IN_ALGORITHM_, affine_on_t), + _WHERE_(_IN_ALGORITHM_, affine_t), _WITH_PRETTY_SENDER_<__cv_child_t>, _WITH_SCHEDULER_(__sched_t)>{}; } @@ -115,9 +115,9 @@ namespace STDEXEC } }; - inline constexpr affine_on_t affine_on{}; + inline constexpr affine_t affine{}; - namespace __affine_on + namespace __affine { template struct __attrs @@ -154,15 +154,15 @@ namespace STDEXEC template STDEXEC_HOST_DEVICE_DEDUCTION_GUIDE __attrs(_Sender const &) -> __attrs<_Sender>; - } // namespace __affine_on + } // namespace __affine template <> - struct __sexpr_impl : __sexpr_defaults + struct __sexpr_impl : __sexpr_defaults { static constexpr auto __get_attrs = // - [](affine_on_t, __ignore, _Child const &__child) noexcept + [](affine_t, __ignore, _Child const &__child) noexcept { - return __affine_on::__attrs{__child}; + return __affine::__attrs{__child}; }; }; } // namespace STDEXEC diff --git a/include/stdexec/__detail/__deprecations.hpp b/include/stdexec/__detail/__deprecations.hpp index d3013eff4..9bdb17443 100644 --- a/include/stdexec/__detail/__deprecations.hpp +++ b/include/stdexec/__detail/__deprecations.hpp @@ -49,6 +49,10 @@ namespace STDEXEC [[deprecated("transfer has been renamed continues_on")]] inline constexpr continues_on_t const & transfer = continues_on; + using affine_on_t [[deprecated("affine_on_t has been renamed affine_t")]] = affine_t; + [[deprecated("affine_on has been renamed affine")]] + inline constexpr affine_t const & affine_on = affine; + using transfer_just_t [[deprecated]] = __transfer_just_t; [[deprecated]] inline constexpr __transfer_just_t const & transfer_just = __transfer_just; diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index 85dbc97c8..2b0ecd517 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -292,8 +292,8 @@ namespace STDEXEC extern on_t const on; ////////////////////////////////////////////////////////////////////////////////////////////////// - struct affine_on_t; - extern affine_on_t const affine_on; + struct affine_t; + extern affine_t const affine; ////////////////////////////////////////////////////////////////////////////////////////////////// struct stopped_as_error_t; diff --git a/include/stdexec/__detail/__task.hpp b/include/stdexec/__detail/__task.hpp index 3c28c1f6b..0a1890745 100644 --- a/include/stdexec/__detail/__task.hpp +++ b/include/stdexec/__detail/__task.hpp @@ -16,7 +16,7 @@ #pragma once #include "../stop_token.hpp" -#include "__affine_on.hpp" +#include "__affine.hpp" #include "__as_awaitable.hpp" #include "__config.hpp" #include "__meta.hpp" @@ -675,7 +675,7 @@ namespace STDEXEC } else { - return STDEXEC::as_awaitable(STDEXEC::affine_on(static_cast<_Sender&&>(__sndr)), *this); + return STDEXEC::as_awaitable(STDEXEC::affine(static_cast<_Sender&&>(__sndr)), *this); } }