Skip to content

Commit 777dc51

Browse files
committed
rename affine_on to affine per wg21
1 parent e2f8632 commit 777dc51

4 files changed

Lines changed: 23 additions & 19 deletions

File tree

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace STDEXEC
2727
struct _CANNOT_MAKE_SENDER_AFFINE_TO_THE_STARTING_SCHEDULER_;
2828
struct _THE_SCHEDULER_IN_THE_CURRENT_EXECUTION_ENVIRONMENT_IS_NOT_INFALLIBLE_;
2929

30-
namespace __affine_on
30+
namespace __affine
3131
{
3232
// For a given completion tag, a sender is "already affine" if either it doesn't send
3333
// that tag, or if its completion behavior for that tag is already "inline" or
@@ -37,21 +37,21 @@ namespace STDEXEC
3737
|| __completion_behavior::__is_affine(
3838
__get_completion_behavior<_Tag, _Sender, _Env>());
3939

40-
// For the purpose of the affine_on algorithm, a sender that is "already affine" for
40+
// For the purpose of the affine algorithm, a sender that is "already affine" for
4141
// all three of the standard completion tags does not need to be adapted to become
4242
// affine.
4343
template <class _Sender, class _Env>
4444
concept __is_affine = __already_affine<set_value_t, _Sender, _Env>
4545
&& __already_affine<set_error_t, _Sender, _Env>
4646
&& __already_affine<set_stopped_t, _Sender, _Env>;
47-
} // namespace __affine_on
47+
} // namespace __affine
4848

49-
struct affine_on_t
49+
struct affine_t
5050
{
5151
template <sender _Sender>
5252
constexpr auto operator()(_Sender &&__sndr) const -> __well_formed_sender auto
5353
{
54-
return __make_sexpr<affine_on_t>({}, static_cast<_Sender &&>(__sndr));
54+
return __make_sexpr<affine_t>({}, static_cast<_Sender &&>(__sndr));
5555
}
5656

5757
constexpr auto operator()() const noexcept
@@ -62,7 +62,7 @@ namespace STDEXEC
6262
template <class _Sender, class _Env>
6363
static constexpr auto transform_sender(set_value_t, _Sender &&__sndr, _Env const &__env)
6464
{
65-
static_assert(__sender_for<_Sender, affine_on_t>);
65+
static_assert(__sender_for<_Sender, affine_t>);
6666
auto &[__tag, __ign, __child] = __sndr;
6767
using __child_t = decltype(__child);
6868
using __cv_child_t = __copy_cvref_t<_Sender, __child_t>;
@@ -75,7 +75,7 @@ namespace STDEXEC
7575
// compile-time error when the child sender is used.
7676
return STDEXEC::__forward_like<_Sender>(__child);
7777
}
78-
else if constexpr (__affine_on::__is_affine<__cv_child_t, _Env>)
78+
else if constexpr (__affine::__is_affine<__cv_child_t, _Env>)
7979
{
8080
// Check the child's completion behavior. If it is "inline" or "async_affine", then
8181
// we can just return the child sender. Otherwise, we need to wrap it.
@@ -88,7 +88,7 @@ namespace STDEXEC
8888
return __not_a_sender< //
8989
_WHAT_(_CANNOT_MAKE_SENDER_AFFINE_TO_THE_STARTING_SCHEDULER_),
9090
_WHY_(_THE_CURRENT_EXECUTION_ENVIRONMENT_DOESNT_HAVE_A_SCHEDULER_),
91-
_WHERE_(_IN_ALGORITHM_, affine_on_t),
91+
_WHERE_(_IN_ALGORITHM_, affine_t),
9292
_WITH_PRETTY_SENDER_<__cv_child_t>,
9393
_WITH_ENVIRONMENT_(_Env)>{};
9494
}
@@ -99,7 +99,7 @@ namespace STDEXEC
9999
return __not_a_sender<
100100
_WHAT_(_CANNOT_MAKE_SENDER_AFFINE_TO_THE_STARTING_SCHEDULER_),
101101
_WHY_(_THE_SCHEDULER_IN_THE_CURRENT_EXECUTION_ENVIRONMENT_IS_NOT_INFALLIBLE_),
102-
_WHERE_(_IN_ALGORITHM_, affine_on_t),
102+
_WHERE_(_IN_ALGORITHM_, affine_t),
103103
_WITH_PRETTY_SENDER_<__cv_child_t>,
104104
_WITH_SCHEDULER_(__sched_t)>{};
105105
}
@@ -114,9 +114,9 @@ namespace STDEXEC
114114
}
115115
};
116116

117-
inline constexpr affine_on_t affine_on{};
117+
inline constexpr affine_t affine{};
118118

119-
namespace __affine_on
119+
namespace __affine
120120
{
121121
template <class _Sender>
122122
struct __attrs
@@ -153,15 +153,15 @@ namespace STDEXEC
153153

154154
template <class _Sender>
155155
STDEXEC_HOST_DEVICE_DEDUCTION_GUIDE __attrs(_Sender const &) -> __attrs<_Sender>;
156-
} // namespace __affine_on
156+
} // namespace __affine
157157

158158
template <>
159-
struct __sexpr_impl<affine_on_t> : __sexpr_defaults
159+
struct __sexpr_impl<affine_t> : __sexpr_defaults
160160
{
161161
static constexpr auto __get_attrs = //
162-
[]<class _Child>(affine_on_t, __ignore, _Child const &__child) noexcept
162+
[]<class _Child>(affine_t, __ignore, _Child const &__child) noexcept
163163
{
164-
return __affine_on::__attrs{__child};
164+
return __affine::__attrs{__child};
165165
};
166166
};
167167
} // namespace STDEXEC

include/stdexec/__detail/__deprecations.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ namespace STDEXEC
4949
[[deprecated("transfer has been renamed continues_on")]]
5050
inline constexpr continues_on_t const & transfer = continues_on;
5151

52+
using affine_on_t [[deprecated("affine_on_t has been renamed affine_t")]] = affine_t;
53+
[[deprecated("affine_on has been renamed affine")]]
54+
inline constexpr affine_t const & affine_on = affine;
55+
5256
using transfer_just_t [[deprecated]] = __transfer_just_t;
5357
[[deprecated]]
5458
inline constexpr __transfer_just_t const & transfer_just = __transfer_just;

include/stdexec/__detail/__execution_fwd.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ namespace STDEXEC
290290
extern on_t const on;
291291

292292
//////////////////////////////////////////////////////////////////////////////////////////////////
293-
struct affine_on_t;
294-
extern affine_on_t const affine_on;
293+
struct affine_t;
294+
extern affine_t const affine;
295295

296296
//////////////////////////////////////////////////////////////////////////////////////////////////
297297
struct stopped_as_error_t;

include/stdexec/__detail/__task.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#pragma once
1717

1818
#include "../stop_token.hpp"
19-
#include "__affine_on.hpp"
19+
#include "__affine.hpp"
2020
#include "__as_awaitable.hpp"
2121
#include "__config.hpp"
2222
#include "__meta.hpp"
@@ -673,7 +673,7 @@ namespace STDEXEC
673673
}
674674
else
675675
{
676-
return STDEXEC::as_awaitable(STDEXEC::affine_on(static_cast<_Sender&&>(__sndr)), *this);
676+
return STDEXEC::as_awaitable(STDEXEC::affine(static_cast<_Sender&&>(__sndr)), *this);
677677
}
678678
}
679679

0 commit comments

Comments
 (0)