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
4 changes: 2 additions & 2 deletions include/beman/execution/detail/affine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace beman::execution::detail {
* scheduler obtained the receiver's environment. The get_start_scheduler query is used
* to obtain the scheduler on which the sender gets started.
*/
struct affine_t {
struct affine_t : ::beman::execution::sender_adaptor_closure<affine_t> {
/**
* @brief Adapt a sender with affine.
*
Expand All @@ -97,7 +97,7 @@ struct affine_t {
*
* @return A sender adaptor for the affine_t.
*/
auto operator()() const { return ::beman::execution::detail::make_sender_adaptor(*this); }
[[deprecated("use `sender | affine` instead of `sender | affine()`")]] auto operator()() const { return *this; }

/**
* @brief affine is implemented by transforming it into a use of continues_on.
Expand Down
7 changes: 5 additions & 2 deletions include/beman/execution/detail/into_variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,16 @@ import beman.execution.detail.variant_or_empty;
// ----------------------------------------------------------------------------

namespace beman::execution::detail {
struct into_variant_t {
struct into_variant_t : ::beman::execution::sender_adaptor_closure<into_variant_t> {
template <::beman::execution::sender Sender>
auto operator()(Sender&& sender) const {
return ::beman::execution::detail::make_sender(*this, {}, ::std::forward<Sender>(sender));
}

auto operator()() const noexcept { return ::beman::execution::detail::make_sender_adaptor(*this); }
[[deprecated("use `sender | into_variant` instead of `sender | into_variant()`")]] auto
operator()() const noexcept {
return *this;
}

private:
template <typename... E>
Expand Down
7 changes: 5 additions & 2 deletions include/beman/execution/detail/stopped_as_optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import beman.execution.detail.then;
#endif

namespace beman::execution::detail {
struct stopped_as_optional_t {
struct stopped_as_optional_t : ::beman::execution::sender_adaptor_closure<stopped_as_optional_t> {
template <::beman::execution::detail::sender_for<stopped_as_optional_t> Sndr, typename Env>
auto transform_sender(::beman::execution::set_value_t, Sndr&& sndr, Env&&) const noexcept {
static_assert(
Expand All @@ -67,7 +67,10 @@ struct stopped_as_optional_t {
return ::beman::execution::detail::make_sender(stopped_as_optional_t{}, {}, ::std::forward<Sndr>(sndr));
}

auto operator()() const noexcept { return ::beman::execution::detail::make_sender_adaptor(*this); }
[[deprecated("use `sender | stopped_as_optional` instead of `sender | stopped_as_optional()`")]] auto
operator()() const noexcept {
return *this;
}
};

} // namespace beman::execution::detail
Expand Down
4 changes: 2 additions & 2 deletions tests/beman/execution/exec-affine.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ auto test_affine_attributes() {

test_std::run_loop loop;
test_std::prop env{test_std::get_start_scheduler, test_std::task_scheduler(loop.get_scheduler())};
auto sndr = s | test_std::affine();
auto sndr = s | test_std::affine;
auto sch = test_std::get_completion_scheduler<test_std::set_value_t>(test_std::get_env(sndr), env);

static_assert(std::same_as<decltype(sch), test_std::task_scheduler>);
Expand All @@ -185,7 +185,7 @@ auto test_affine_attributes() {

TEST(affine) {
static_assert(test_std::sender<decltype(test_std::affine(test_std::just(42)))>);
static_assert(test_std::sender<decltype(test_std::just(42) | test_std::affine())>);
static_assert(test_std::sender<decltype(test_std::just(42) | test_std::affine)>);

static_assert(test_std::sender_in<decltype(test_std::affine(test_std::just(42))), test_std::env<>>);

Expand Down
2 changes: 1 addition & 1 deletion tests/beman/execution/exec-snd-concepts.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ auto test_sender_in() -> void {
test_std::prop env_has_start_scheduler{test_std::get_start_scheduler, loop.get_scheduler()};

auto sndr = test_std::just() |
test_std::let_value([] { return test_std::read_env(test_std::get_allocator) | test_std::affine(); });
test_std::let_value([] { return test_std::read_env(test_std::get_allocator) | test_std::affine; });
static_assert(!test_std::sender_in<decltype(sndr), test_std::env<>>);
static_assert(test_std::sender_in<decltype(sndr), decltype(env_has_allocator)>);
auto [al] = test_std::sync_wait(sndr | test_std::write_env(env_has_allocator)).value();
Expand Down
2 changes: 1 addition & 1 deletion tests/beman/execution/exec-stopped-opt.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import beman.execution.detail;
// ----------------------------------------------------------------------------
namespace {
auto test_stopped_as_optional() -> void {
test_std::sender auto sndr1 = test_std::just(42) | test_std::stopped_as_optional();
test_std::sender auto sndr1 = test_std::just(42) | test_std::stopped_as_optional;
using sigs_of_sndr1 = test_std::completion_signatures_of_t<decltype(sndr1), test_detail::sync_wait_env>;
static_assert(
std::same_as<sigs_of_sndr1, test_std::completion_signatures<test_std::set_value_t(std::optional<int>)>>);
Expand Down
Loading