diff --git a/include/beman/execution/detail/affine.hpp b/include/beman/execution/detail/affine.hpp index cb6d556d..a18564ca 100644 --- a/include/beman/execution/detail/affine.hpp +++ b/include/beman/execution/detail/affine.hpp @@ -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 { /** * @brief Adapt a sender with affine. * @@ -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. diff --git a/include/beman/execution/detail/into_variant.hpp b/include/beman/execution/detail/into_variant.hpp index 6d51375a..63146798 100644 --- a/include/beman/execution/detail/into_variant.hpp +++ b/include/beman/execution/detail/into_variant.hpp @@ -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 { template <::beman::execution::sender Sender> auto operator()(Sender&& sender) const { return ::beman::execution::detail::make_sender(*this, {}, ::std::forward(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 diff --git a/include/beman/execution/detail/stopped_as_optional.hpp b/include/beman/execution/detail/stopped_as_optional.hpp index 21eb4f18..9fe0a5a1 100644 --- a/include/beman/execution/detail/stopped_as_optional.hpp +++ b/include/beman/execution/detail/stopped_as_optional.hpp @@ -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 { template <::beman::execution::detail::sender_for Sndr, typename Env> auto transform_sender(::beman::execution::set_value_t, Sndr&& sndr, Env&&) const noexcept { static_assert( @@ -67,7 +67,10 @@ struct stopped_as_optional_t { return ::beman::execution::detail::make_sender(stopped_as_optional_t{}, {}, ::std::forward(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 diff --git a/tests/beman/execution/exec-affine.test.cpp b/tests/beman/execution/exec-affine.test.cpp index bf8e89f2..8a757124 100644 --- a/tests/beman/execution/exec-affine.test.cpp +++ b/tests/beman/execution/exec-affine.test.cpp @@ -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::get_env(sndr), env); static_assert(std::same_as); @@ -185,7 +185,7 @@ auto test_affine_attributes() { TEST(affine) { static_assert(test_std::sender); - static_assert(test_std::sender); + static_assert(test_std::sender); static_assert(test_std::sender_in>); diff --git a/tests/beman/execution/exec-snd-concepts.test.cpp b/tests/beman/execution/exec-snd-concepts.test.cpp index 54f21017..ab7b9a4b 100644 --- a/tests/beman/execution/exec-snd-concepts.test.cpp +++ b/tests/beman/execution/exec-snd-concepts.test.cpp @@ -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>); static_assert(test_std::sender_in); auto [al] = test_std::sync_wait(sndr | test_std::write_env(env_has_allocator)).value(); diff --git a/tests/beman/execution/exec-stopped-opt.test.cpp b/tests/beman/execution/exec-stopped-opt.test.cpp index aaa96f2f..5c00e668 100644 --- a/tests/beman/execution/exec-stopped-opt.test.cpp +++ b/tests/beman/execution/exec-stopped-opt.test.cpp @@ -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; static_assert( std::same_as)>>);