Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <class _Sender, class _Env>
concept __is_affine = __already_affine<set_value_t, _Sender, _Env>
&& __already_affine<set_error_t, _Sender, _Env>
&& __already_affine<set_stopped_t, _Sender, _Env>;
} // namespace __affine_on
} // namespace __affine

struct affine_on_t
struct affine_t
{
template <sender _Sender>
constexpr auto operator()(_Sender &&__sndr) const -> __well_formed_sender auto
{
return __make_sexpr<affine_on_t>({}, static_cast<_Sender &&>(__sndr));
return __make_sexpr<affine_t>({}, static_cast<_Sender &&>(__sndr));
}

constexpr auto operator()() const noexcept
Expand All @@ -62,7 +62,7 @@ namespace STDEXEC
template <class _Sender, class _Env>
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>;
Expand All @@ -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.
Expand All @@ -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)>{};
}
Expand All @@ -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)>{};
}
Expand All @@ -115,9 +115,9 @@ namespace STDEXEC
}
};

inline constexpr affine_on_t affine_on{};
inline constexpr affine_t affine{};

namespace __affine_on
namespace __affine
{
template <class _Sender>
struct __attrs
Expand Down Expand Up @@ -154,15 +154,15 @@ namespace STDEXEC

template <class _Sender>
STDEXEC_HOST_DEVICE_DEDUCTION_GUIDE __attrs(_Sender const &) -> __attrs<_Sender>;
} // namespace __affine_on
} // namespace __affine

template <>
struct __sexpr_impl<affine_on_t> : __sexpr_defaults
struct __sexpr_impl<affine_t> : __sexpr_defaults
{
static constexpr auto __get_attrs = //
[]<class _Child>(affine_on_t, __ignore, _Child const &__child) noexcept
[]<class _Child>(affine_t, __ignore, _Child const &__child) noexcept
{
return __affine_on::__attrs{__child};
return __affine::__attrs{__child};
};
};
} // namespace STDEXEC
4 changes: 4 additions & 0 deletions include/stdexec/__detail/__deprecations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions include/stdexec/__detail/__execution_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions include/stdexec/__detail/__task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
}

Expand Down
Loading