diff --git a/.clangd b/.clangd index 5bb22363b..ea3b3fd5c 100644 --- a/.clangd +++ b/.clangd @@ -77,6 +77,7 @@ CompileFlags: - -Xtemplight - -profiler - -ignore-system + - "-fconcepts-diagnostics-depth=*" Diagnostics: Suppress: - "variadic_device_fn" diff --git a/examples/nvexec/maxwell/snr.cuh b/examples/nvexec/maxwell/snr.cuh index 32f7eede8..c040c1ef4 100644 --- a/examples/nvexec/maxwell/snr.cuh +++ b/examples/nvexec/maxwell/snr.cuh @@ -20,8 +20,8 @@ #include "common.cuh" #include "stdexec/execution.hpp" -#include "exec/on.hpp" +namespace ex = stdexec; #if defined(_NVHPC_CUDA) || defined(__CUDACC__) # include "nvexec/detail/throw_on_cuda_error.cuh" @@ -30,18 +30,18 @@ #else namespace nvexec { struct stream_receiver_base { - using receiver_concept = stdexec::receiver_t; + using receiver_concept = ex::receiver_t; }; struct stream_sender_base { - using sender_concept = stdexec::sender_t; + using sender_concept = ex::sender_t; }; namespace detail { struct stream_op_state_base { }; } // namespace detail - inline bool is_on_gpu() { + inline auto is_on_gpu() -> bool { return false; } } // namespace nvexec @@ -73,13 +73,13 @@ namespace nvexec::_strm::repeat_n { op_state_.i_++; if (op_state_.i_ == op_state_.n_) { - op_state_.propagate_completion_signal(stdexec::set_value); + op_state_.propagate_completion_signal(ex::set_value); return; } - auto sch = stdexec::get_scheduler(stdexec::get_env(op_state_.rcvr_)); + auto sch = ex::get_scheduler(ex::get_env(op_state_.rcvr_)); inner_op_state_t& inner_op_state = op_state_.inner_op_state_.emplace( - stdexec::__emplace_from{[&]() noexcept { + ex::__emplace_from{[&]() noexcept { return ex::connect(ex::schedule(sch) | op_state_.closure_, receiver_2_t{op_state_}); }}); @@ -115,9 +115,9 @@ namespace nvexec::_strm::repeat_n { using inner_op_state_t = typename OpT::inner_op_state_t; if (op_state_.n_) { - auto sch = stdexec::get_scheduler(stdexec::get_env(op_state_.rcvr_)); + auto sch = ex::get_scheduler(ex::get_env(op_state_.rcvr_)); inner_op_state_t& inner_op_state = op_state_.inner_op_state_.emplace( - stdexec::__emplace_from{[&]() noexcept { + ex::__emplace_from{[&]() noexcept { return ex::connect( ex::schedule(sch) | op_state_.closure_, receiver_2_t{op_state_}); }}); @@ -148,10 +148,10 @@ namespace nvexec::_strm::repeat_n { template struct operation_state_t : operation_state_base_t { - using PredSender = stdexec::__t; - using Receiver = stdexec::__t; - using Scheduler = std::invoke_result_t>; - using InnerSender = std::invoke_result_t>; + using PredSender = ex::__t; + using Receiver = ex::__t; + using Scheduler = std::invoke_result_t>; + using InnerSender = std::invoke_result_t>; using predecessor_op_state_t = ex::connect_result_t>; @@ -168,12 +168,12 @@ namespace nvexec::_strm::repeat_n { if (this->stream_provider_.status_ != cudaSuccess) { // Couldn't allocate memory for operation state, complete with error this->propagate_completion_signal( - stdexec::set_error, std::move(this->stream_provider_.status_)); + ex::set_error, std::move(this->stream_provider_.status_)); } else { if (n_) { - stdexec::start(*pred_op_state_); + ex::start(*pred_op_state_); } else { - this->propagate_completion_signal(stdexec::set_value); + this->propagate_completion_signal(ex::set_value); } } } @@ -181,12 +181,12 @@ namespace nvexec::_strm::repeat_n { operation_state_t(PredSender&& pred_sender, Closure closure, Receiver&& rcvr, std::size_t n) : operation_state_base_t( static_cast(rcvr), - stdexec::get_completion_scheduler(stdexec::get_env(pred_sender)) + ex::get_completion_scheduler(ex::get_env(pred_sender)) .context_state_) , pred_sender_{static_cast(pred_sender)} , closure_(closure) , n_(n) { - pred_op_state_.emplace(stdexec::__emplace_from{[&]() noexcept { + pred_op_state_.emplace(ex::__emplace_from{[&]() noexcept { return ex::connect(static_cast(pred_sender_), receiver_1_t{*this}); }}); } @@ -204,7 +204,7 @@ namespace repeat_n_detail { OpT& op_state_; public: - using receiver_concept = stdexec::receiver_t; + using receiver_concept = ex::receiver_t; void set_value() noexcept { using inner_op_state_t = typename OpT::inner_op_state_t; @@ -212,13 +212,13 @@ namespace repeat_n_detail { op_state_.i_++; if (op_state_.i_ == op_state_.n_) { - stdexec::set_value(std::move(op_state_.rcvr_)); + ex::set_value(std::move(op_state_.rcvr_)); return; } - auto sch = stdexec::get_scheduler(stdexec::get_env(op_state_.rcvr_)); + auto sch = ex::get_scheduler(ex::get_env(op_state_.rcvr_)); inner_op_state_t& inner_op_state = op_state_.inner_op_state_.emplace( - stdexec::__emplace_from{[&]() noexcept { + ex::__emplace_from{[&]() noexcept { return ex::connect(ex::schedule(sch) | op_state_.closure_, receiver_2_t{op_state_}); }}); @@ -227,16 +227,16 @@ namespace repeat_n_detail { template void set_error(Error&& err) noexcept { - stdexec::set_error(std::move(op_state_.rcvr_), static_cast(err)); + ex::set_error(std::move(op_state_.rcvr_), static_cast(err)); } void set_stopped() noexcept { - stdexec::set_stopped(std::move(op_state_.rcvr_)); + ex::set_stopped(std::move(op_state_.rcvr_)); } [[nodiscard]] - auto get_env() const noexcept -> stdexec::env_of_t { - return stdexec::get_env(op_state_.rcvr_); + auto get_env() const noexcept -> ex::env_of_t { + return ex::get_env(op_state_.rcvr_); } explicit receiver_2_t(OpT& op_state) @@ -251,37 +251,37 @@ namespace repeat_n_detail { OpT& op_state_; public: - using receiver_concept = stdexec::receiver_t; + using receiver_concept = ex::receiver_t; void set_value() noexcept { using inner_op_state_t = typename OpT::inner_op_state_t; if (op_state_.n_) { - auto sch = stdexec::get_scheduler(stdexec::get_env(op_state_.rcvr_)); + auto sch = ex::get_scheduler(ex::get_env(op_state_.rcvr_)); inner_op_state_t& inner_op_state = op_state_.inner_op_state_.emplace( - stdexec::__emplace_from{[&]() noexcept { + ex::__emplace_from{[&]() noexcept { return ex::connect( ex::schedule(sch) | op_state_.closure_, receiver_2_t{op_state_}); }}); ex::start(inner_op_state); } else { - stdexec::set_value(std::move(op_state_.rcvr_)); + ex::set_value(std::move(op_state_.rcvr_)); } } template void set_error(Error&& err) noexcept { - stdexec::set_error(std::move(op_state_.rcvr_), static_cast(err)); + ex::set_error(std::move(op_state_.rcvr_), static_cast(err)); } void set_stopped() noexcept { - stdexec::set_stopped(std::move(op_state_.rcvr_)); + ex::set_stopped(std::move(op_state_.rcvr_)); } [[nodiscard]] - auto get_env() const noexcept -> stdexec::env_of_t { - return stdexec::get_env(op_state_.rcvr_); + auto get_env() const noexcept -> ex::env_of_t { + return ex::get_env(op_state_.rcvr_); } explicit receiver_1_t(OpT& op_state) @@ -291,10 +291,10 @@ namespace repeat_n_detail { template struct operation_state_t { - using PredSender = stdexec::__t; - using Receiver = stdexec::__t; - using Scheduler = std::invoke_result_t>; - using InnerSender = std::invoke_result_t>; + using PredSender = ex::__t; + using Receiver = ex::__t; + using Scheduler = std::invoke_result_t>; + using InnerSender = std::invoke_result_t>; using predecessor_op_state_t = ex::connect_result_t>; @@ -310,9 +310,9 @@ namespace repeat_n_detail { void start() & noexcept { if (n_) { - stdexec::start(*pred_op_state_); + ex::start(*pred_op_state_); } else { - stdexec::set_value(std::move(rcvr_)); + ex::set_value(std::move(rcvr_)); } } @@ -321,7 +321,7 @@ namespace repeat_n_detail { , closure_(closure) , rcvr_(rcvr) , n_(n) { - pred_op_state_.emplace(stdexec::__emplace_from{[&]() noexcept { + pred_op_state_.emplace(ex::__emplace_from{[&]() noexcept { return ex::connect(static_cast(pred_sender_), receiver_1_t{*this}); }}); } @@ -331,16 +331,16 @@ namespace repeat_n_detail { struct repeat_n_sender_t { using __t = repeat_n_sender_t; using __id = repeat_n_sender_t; - using Sender = stdexec::__t; - using sender_concept = stdexec::sender_t; + using Sender = ex::__t; + using sender_concept = ex::sender_t; - using completion_signatures = stdexec::completion_signatures< - stdexec::set_value_t(), - stdexec::set_stopped_t(), - stdexec::set_error_t(std::exception_ptr) + using completion_signatures = ex::completion_signatures< + ex::set_value_t(), + ex::set_stopped_t(), + ex::set_error_t(std::exception_ptr) #if defined(_NVHPC_CUDA) || defined(__CUDACC__) , - stdexec::set_error_t(cudaError_t) + ex::set_error_t(cudaError_t) #endif >; @@ -349,50 +349,50 @@ namespace repeat_n_detail { std::size_t n_{}; #if defined(_NVHPC_CUDA) || defined(__CUDACC__) - template Self, stdexec::receiver Receiver> - requires(stdexec::sender_to) + template Self, ex::receiver Receiver> + requires(ex::sender_to) && (!nvexec::_strm::receiver_with_stream_env) - friend auto tag_invoke(stdexec::connect_t, Self&& self, Receiver r) - -> repeat_n_detail::operation_state_t> { - return repeat_n_detail::operation_state_t>( + friend auto tag_invoke(ex::connect_t, Self&& self, Receiver r) + -> repeat_n_detail::operation_state_t> { + return repeat_n_detail::operation_state_t>( static_cast(self.sender_), self.closure_, static_cast(r), self.n_); } - template Self, stdexec::receiver Receiver> - requires(stdexec::sender_to) + template Self, ex::receiver Receiver> + requires(ex::sender_to) && (nvexec::_strm::receiver_with_stream_env) - friend auto tag_invoke(stdexec::connect_t, Self&& self, Receiver r) - -> nvexec::_strm::repeat_n::operation_state_t> { - return nvexec::_strm::repeat_n::operation_state_t>( + friend auto tag_invoke(ex::connect_t, Self&& self, Receiver r) + -> nvexec::_strm::repeat_n::operation_state_t> { + return nvexec::_strm::repeat_n::operation_state_t>( static_cast(self.sender_), self.closure_, static_cast(r), self.n_); } #else - template Self, stdexec::receiver Receiver> - requires stdexec::sender_to - friend auto tag_invoke(stdexec::connect_t, Self&& self, Receiver r) - -> repeat_n_detail::operation_state_t> { - return repeat_n_detail::operation_state_t>( + template Self, ex::receiver Receiver> + requires ex::sender_to + friend auto tag_invoke(ex::connect_t, Self&& self, Receiver r) + -> repeat_n_detail::operation_state_t> { + return repeat_n_detail::operation_state_t>( static_cast(self.sender_), self.closure_, static_cast(r), self.n_); } #endif - auto get_env() const noexcept -> stdexec::env_of_t { - return stdexec::get_env(sender_); + auto get_env() const noexcept -> ex::env_of_t { + return ex::get_env(sender_); } }; } // namespace repeat_n_detail struct repeat_n_t { - template + template auto operator()(Sender&& __sndr, std::size_t n, Closure closure) const noexcept - -> repeat_n_detail::repeat_n_sender_t, Closure> { - return repeat_n_detail::repeat_n_sender_t, Closure>{ + -> repeat_n_detail::repeat_n_sender_t, Closure> { + return repeat_n_detail::repeat_n_sender_t, Closure>{ std::forward(__sndr), closure, n}; } - template + template auto operator()(std::size_t n, Closure closure) const - -> stdexec::__binder_back { + -> ex::__binder_back { return { {n, static_cast(closure)}, {}, @@ -406,8 +406,8 @@ inline constexpr repeat_n_t repeat_n{}; template [[nodiscard]] auto is_gpu_scheduler(SchedulerT&& scheduler) -> bool { - auto snd = ex::just() | exec::on(scheduler, ex::then([] { return nvexec::is_on_gpu(); })); - auto [on_gpu] = stdexec::sync_wait(std::move(snd)).value(); + auto snd = ex::just() | ex::on(scheduler, ex::then([] { return nvexec::is_on_gpu(); })); + auto [on_gpu] = ex::sync_wait(std::move(snd)).value(); return on_gpu; } @@ -417,9 +417,9 @@ auto maxwell_eqs_snr( bool write_results, std::size_t n_iterations, fields_accessor accessor, - stdexec::scheduler auto&& computer) { + ex::scheduler auto&& computer) { return ex::just() - | exec::on( + | ex::on( computer, repeat_n( n_iterations, @@ -434,18 +434,18 @@ void run_snr( std::size_t n_iterations, grid_t& grid, std::string_view scheduler_name, - stdexec::scheduler auto&& computer) { + ex::scheduler auto&& computer) { time_storage_t time{is_gpu_scheduler(computer)}; fields_accessor accessor = grid.accessor(); auto init = ex::just() - | exec::on(computer, ex::bulk(ex::par, grid.cells, grid_initializer(dt, accessor))); - stdexec::sync_wait(init); + | ex::on(computer, ex::bulk(ex::par, grid.cells, grid_initializer(dt, accessor))); + ex::sync_wait(init); auto snd = maxwell_eqs_snr(dt, time.get(), write_vtk, n_iterations, accessor, computer); report_performance(grid.cells, n_iterations, scheduler_name, [&snd] { - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); }); } diff --git a/examples/nvexec/maxwell_distributed.cpp b/examples/nvexec/maxwell_distributed.cpp index e71a4c20c..190ad779c 100644 --- a/examples/nvexec/maxwell_distributed.cpp +++ b/examples/nvexec/maxwell_distributed.cpp @@ -428,7 +428,7 @@ auto main(int argc, char *argv[]) -> int { }; }; - stdexec::sync_wait( + ex::sync_wait( ex::schedule(gpu) | ex::bulk(ex::par, accessor.own_cells(), distributed::grid_initializer(dt, accessor))); @@ -485,17 +485,17 @@ auto main(int argc, char *argv[]) -> int { for (std::size_t compute_step = 0; compute_step < n_iterations; compute_step++) { auto compute_h = ex::when_all( - ex::just() | exec::on(gpu, ex::bulk(ex::par, bulk_cells, bulk_h_update)), - ex::just() | exec::on(gpu_with_priority, ex::bulk(ex::par, border_cells, border_h_update)) + ex::just() | ex::on(gpu, ex::bulk(ex::par, bulk_cells, bulk_h_update)), + ex::just() | ex::on(gpu_with_priority, ex::bulk(ex::par, border_cells, border_h_update)) | ex::then(exchange_hx)); auto compute_e = ex::when_all( - ex::just() | exec::on(gpu, ex::bulk(ex::par, bulk_cells, bulk_e_update)), - ex::just() | exec::on(gpu_with_priority, ex::bulk(ex::par, border_cells, border_e_update)) + ex::just() | ex::on(gpu, ex::bulk(ex::par, bulk_cells, bulk_e_update)), + ex::just() | ex::on(gpu_with_priority, ex::bulk(ex::par, border_cells, border_e_update)) | ex::then(exchange_ez)); - stdexec::sync_wait(std::move(compute_h)); - stdexec::sync_wait(std::move(compute_e)); + ex::sync_wait(std::move(compute_h)); + ex::sync_wait(std::move(compute_e)); } write(); @@ -503,18 +503,18 @@ auto main(int argc, char *argv[]) -> int { for (std::size_t compute_step = 0; compute_step < n_iterations; compute_step++) { auto compute_h = ex::just() - | exec::on(gpu, ex::bulk(ex::par, accessor.own_cells(), distributed::update_h(accessor))) + | ex::on(gpu, ex::bulk(ex::par, accessor.own_cells(), distributed::update_h(accessor))) | ex::then(exchange_hx); auto compute_e = ex::just() - | exec::on( + | ex::on( gpu, ex::bulk(ex::par, accessor.own_cells(), distributed::update_e(time.get(), dt, accessor))) | ex::then(exchange_ez); - stdexec::sync_wait(std::move(compute_h)); - stdexec::sync_wait(std::move(compute_e)); + ex::sync_wait(std::move(compute_h)); + ex::sync_wait(std::move(compute_e)); } write(); diff --git a/include/exec/on.hpp b/include/exec/on.hpp index 450bb59bd..41320a288 100644 --- a/include/exec/on.hpp +++ b/include/exec/on.hpp @@ -15,11 +15,13 @@ */ #pragma once -#include "../stdexec/execution.hpp" +#include "../stdexec/execution.hpp" // IWYU pragma: keep namespace exec { ///////////////////////////////////////////////////////////////////////////// // A scoped version of [execution.senders.adaptors.on] - using stdexec::v2::on_t; - using stdexec::v2::on; + using on_t [[deprecated("on_t has been moved to the stdexec:: namespace")]] = stdexec::on_t; + + [[deprecated("on has been moved to the stdexec:: namespace")]] + inline constexpr on_t const& on = stdexec::on; } // namespace exec diff --git a/include/stdexec/__detail/__continues_on.hpp b/include/stdexec/__detail/__continues_on.hpp index 15876edd1..28c10037e 100644 --- a/include/stdexec/__detail/__continues_on.hpp +++ b/include/stdexec/__detail/__continues_on.hpp @@ -86,12 +86,19 @@ namespace stdexec { using __continues_on::continues_on_t; inline constexpr continues_on_t continues_on{}; + // Backward compatibility: using transfer_t = continues_on_t; inline constexpr continues_on_t transfer{}; using continue_on_t = continues_on_t; inline constexpr continues_on_t continue_on{}; + namespace v2 { + using continue_on_t [[deprecated("use stdexec::continues_on_t instead")]] = stdexec::continues_on_t; + [[deprecated("use stdexec::continues_on instead")]] + inline constexpr stdexec::continues_on_t const& continue_on = stdexec::continues_on; + } // namespace v2 + template <> struct __sexpr_impl : __continues_on::__continues_on_impl { }; } // namespace stdexec diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index 112142bb8..bd1e8a5c5 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -212,10 +212,6 @@ namespace stdexec { using __starts_on_ns::starts_on_t; extern const starts_on_t starts_on; - using on_t [[deprecated("on_t has been renamed starts_on_t")]] = starts_on_t; - [[deprecated("on has been renamed starts_on")]] - extern const starts_on_t on; - using start_on_t [[deprecated("start_on_t has been renamed starts_on_t")]] = starts_on_t; [[deprecated("start_on has been renamed starts_on")]] extern const starts_on_t start_on; @@ -284,13 +280,12 @@ namespace stdexec { extern const ensure_started_t ensure_started; ////////////////////////////////////////////////////////////////////////////////////////////////// - namespace __on_v2 { + namespace __on { struct on_t; - } // namespace __on_v2 + } // namespace __on - namespace v2 { - using __on_v2::on_t; - } // namespace v2 + using __on::on_t; + extern const on_t on; namespace __detail { struct __sexpr_apply_t; diff --git a/include/stdexec/__detail/__on.hpp b/include/stdexec/__detail/__on.hpp index adbd936d7..52c3dde9b 100644 --- a/include/stdexec/__detail/__on.hpp +++ b/include/stdexec/__detail/__on.hpp @@ -38,7 +38,7 @@ namespace stdexec { ///////////////////////////////////////////////////////////////////////////// // [execution.senders.adaptors.on] - namespace __on_v2 { + namespace __on { inline constexpr __mstring __on_context = "In stdexec::on(Scheduler, Sender)..."_mstr; inline constexpr __mstring __no_scheduler_diag = "stdexec::on() requires a scheduler to transition back to."_mstr; @@ -200,18 +200,19 @@ namespace stdexec { } } }; - } // namespace __on_v2 + } // namespace __on - namespace v2 { - using __on_v2::on_t; - inline constexpr on_t on{}; + using __on::on_t; + inline constexpr on_t on{}; - using continue_on_t = v2::on_t; - inline constexpr continue_on_t continue_on{}; // for back-compat + namespace v2 { + using on_t [[deprecated("use stdexec::on_t instead")]] = stdexec::on_t; + [[deprecated("use stdexec::on instead")]] + inline constexpr stdexec::on_t const& on = stdexec::on; } // namespace v2 template <> - struct __sexpr_impl : __sexpr_defaults { + struct __sexpr_impl : __sexpr_defaults { static constexpr auto get_completion_signatures = [](_Sender&&) noexcept -> __merror_or_t< __completion_signatures_of_t>>, diff --git a/include/stdexec/__detail/__starts_on.hpp b/include/stdexec/__detail/__starts_on.hpp index 3b3793a34..736f7f022 100644 --- a/include/stdexec/__detail/__starts_on.hpp +++ b/include/stdexec/__detail/__starts_on.hpp @@ -76,7 +76,7 @@ namespace stdexec { static auto transform_sender(_Sender&& __sndr, const _Env&) { return __sexpr_apply( static_cast<_Sender&&>(__sndr), - [](__ignore, _Data&& __data, _Child&& __child) { + [](__ignore, _Data&& __data, _Child&& __child) -> auto { // This is the heart of starts_on: It uses `let_value` to schedule `__child` on the given scheduler: return let_value(schedule(__data), __detail::__always{static_cast<_Child&&>(__child)}); }); @@ -87,9 +87,6 @@ namespace stdexec { using __starts_on_ns::starts_on_t; inline constexpr starts_on_t starts_on{}; - using on_t = starts_on_t; - inline constexpr starts_on_t on{}; - using start_on_t = starts_on_t; inline constexpr starts_on_t start_on{}; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2e243e9f5..4ec591f68 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -36,6 +36,9 @@ set(stdexec_test_sources stdexec/algos/factories/test_just_stopped.cpp stdexec/algos/factories/test_read.cpp stdexec/algos/adaptors/test_starts_on.cpp + stdexec/algos/adaptors/test_on.cpp + stdexec/algos/adaptors/test_on2.cpp + stdexec/algos/adaptors/test_on3.cpp stdexec/algos/adaptors/test_continues_on.cpp stdexec/algos/adaptors/test_schedule_from.cpp stdexec/algos/adaptors/test_then.cpp diff --git a/test/exec/CMakeLists.txt b/test/exec/CMakeLists.txt index e1a1000bc..50eff8e79 100644 --- a/test/exec/CMakeLists.txt +++ b/test/exec/CMakeLists.txt @@ -26,9 +26,6 @@ set(exec_test_sources test_env.cpp test_finally.cpp test_into_tuple.cpp - test_on.cpp - test_on2.cpp - test_on3.cpp test_repeat_effect_until.cpp test_repeat_n.cpp async_scope/test_dtor.cpp diff --git a/test/exec/sequence/test_transform_each.cpp b/test/exec/sequence/test_transform_each.cpp index 755dfe384..cb96ba708 100644 --- a/test/exec/sequence/test_transform_each.cpp +++ b/test/exec/sequence/test_transform_each.cpp @@ -35,7 +35,7 @@ namespace { struct next_rcvr { using __id = next_rcvr; using __t = next_rcvr; - using receiver_concept = stdexec::receiver_t; + using receiver_concept = ex::receiver_t; friend auto tag_invoke(exec::set_next_t, next_rcvr, auto item) { return item; @@ -50,9 +50,9 @@ namespace { "[sequence_senders][transform_each][empty_sequence]") { int counter = 0; auto transformed = exec::transform_each( - exec::empty_sequence(), stdexec::then([&counter]() noexcept { ++counter; })); + exec::empty_sequence(), ex::then([&counter]() noexcept { ++counter; })); auto op = exec::subscribe(transformed, next_rcvr{}); - stdexec::start(op); + ex::start(op); CHECK(counter == 0); } @@ -61,9 +61,9 @@ namespace { "[sequence_senders][transform_each]") { int value = 0; auto transformed = exec::transform_each( - stdexec::just(42), stdexec::then([&value](int x) noexcept { value = x; })); + ex::just(42), ex::then([&value](int x) noexcept { value = x; })); auto op = exec::subscribe(transformed, next_rcvr{}); - stdexec::start(op); + ex::start(op); CHECK(value == 42); } @@ -71,11 +71,11 @@ namespace { "transform_each - transform sender applies adaptor to a sender and ignores all values", "[sequence_senders][transform_each][ignore_all_values]") { int value = 0; - auto transformed = exec::transform_each(stdexec::just(42), stdexec::then([&value](int x) { + auto transformed = exec::transform_each(ex::just(42), ex::then([&value](int x) { value = x; })) | exec::ignore_all_values(); - stdexec::sync_wait(transformed); + ex::sync_wait(transformed); CHECK(value == 42); } @@ -87,11 +87,11 @@ namespace { return exec::iterate(std::views::iota(from, to)); }; auto then_each = [](auto f) { - return exec::transform_each(stdexec::then(f)); + return exec::transform_each(ex::then(f)); }; int total = 0; auto sum = range(0, 10) | then_each([&total](int x) noexcept { total += x; }); - stdexec::sync_wait(exec::ignore_all_values(sum)); + ex::sync_wait(exec::ignore_all_values(sum)); CHECK(total == 45); } #endif @@ -108,13 +108,13 @@ namespace { basic_inline_scheduler sched; int result = 0; auto start = ex::just(std::string{"hello"}); - auto with_scheduler = exec::write_env(stdexec::prop{ex::get_scheduler, inline_scheduler()}); - auto adaptor = exec::on(sched, ex::then([](std::string x) { return x + ", world"; })) + auto with_scheduler = exec::write_env(ex::prop{ex::get_scheduler, inline_scheduler()}); + auto adaptor = ex::on(sched, ex::then([](std::string x) { return x + ", world"; })) | with_scheduler; auto snd = start | exec::transform_each(adaptor) | exec::transform_each(ex::then([&](int x) { result = x; })) | exec::ignore_all_values(); - stdexec::sync_wait(snd); + ex::sync_wait(snd); CHECK(result == 42); } } // namespace diff --git a/test/exec/test_repeat_effect_until.cpp b/test/exec/test_repeat_effect_until.cpp index a5d6572cc..7c2508c32 100644 --- a/test/exec/test_repeat_effect_until.cpp +++ b/test/exec/test_repeat_effect_until.cpp @@ -32,15 +32,15 @@ #include #include -using namespace stdexec; +namespace ex = stdexec; namespace { struct boolean_sender { - using sender_concept = stdexec::sender_t; + using sender_concept = ex::sender_t; using __t = boolean_sender; using __id = boolean_sender; - using completion_signatures = stdexec::completion_signatures; + using completion_signatures = ex::completion_signatures; template struct operation { @@ -49,15 +49,15 @@ namespace { void start() & noexcept { if (counter_ == 0) { - stdexec::set_value(static_cast(rcvr_), true); + ex::set_value(static_cast(rcvr_), true); } else { - stdexec::set_value(static_cast(rcvr_), false); + ex::set_value(static_cast(rcvr_), false); } } }; - template Receiver> - friend auto tag_invoke(connect_t, boolean_sender self, Receiver rcvr) -> operation { + template Receiver> + friend auto tag_invoke(ex::connect_t, boolean_sender self, Receiver rcvr) -> operation { return {static_cast(rcvr), --*self.counter_}; } @@ -65,7 +65,7 @@ namespace { }; TEST_CASE("repeat_effect_until returns a sender", "[adaptors][repeat_effect_until]") { - auto snd = exec::repeat_effect_until(ex::just() | then([] { return false; })); + auto snd = exec::repeat_effect_until(ex::just() | ex::then([] { return false; })); static_assert(ex::sender); (void) snd; } @@ -73,7 +73,7 @@ namespace { TEST_CASE( "repeat_effect_until with environment returns a sender", "[adaptors][repeat_effect_until]") { - auto snd = exec::repeat_effect_until(just() | then([] { return true; })); + auto snd = exec::repeat_effect_until(ex::just() | ex::then([] { return true; })); static_assert(ex::sender_in>); (void) snd; } @@ -81,31 +81,31 @@ namespace { TEST_CASE( "repeat_effect_until produces void value to downstream receiver", "[adaptors][repeat_effect_until]") { - sender auto source = just(1) | then([](int) { return true; }); - sender auto snd = exec::repeat_effect_until(std::move(source)); + ex::sender auto source = ex::just(1) | ex::then([](int) { return true; }); + ex::sender auto snd = exec::repeat_effect_until(std::move(source)); // The receiver checks if we receive the void value - auto op = stdexec::connect(std::move(snd), expect_void_receiver{}); - stdexec::start(op); + auto op = ex::connect(std::move(snd), expect_void_receiver{}); + ex::start(op); } TEST_CASE("simple example for repeat_effect_until", "[adaptors][repeat_effect_until]") { - sender auto snd = exec::repeat_effect_until(boolean_sender{}); - stdexec::sync_wait(std::move(snd)); + ex::sender auto snd = exec::repeat_effect_until(boolean_sender{}); + ex::sync_wait(std::move(snd)); } TEST_CASE("repeat_effect_until works with pipeline operator", "[adaptors][repeat_effect_until]") { bool should_stopped = true; - ex::sender auto snd = just(should_stopped) | exec::repeat_effect_until() - | then([] { return 1; }); + ex::sender auto snd = ex::just(should_stopped) | exec::repeat_effect_until() + | ex::then([] { return 1; }); wait_for_value(std::move(snd), 1); } TEST_CASE( "repeat_effect_until works when input sender produces an int value", "[adaptors][repeat_effect_until]") { - sender auto snd = exec::repeat_effect_until(just(1)); - auto op = stdexec::connect(std::move(snd), expect_void_receiver{}); - stdexec::start(op); + ex::sender auto snd = exec::repeat_effect_until(ex::just(1)); + auto op = ex::connect(std::move(snd), expect_void_receiver{}); + ex::start(op); } TEST_CASE( @@ -120,44 +120,44 @@ namespace { }; pred p; - auto input_snd = just() | then([&p] { return p; }); - stdexec::sync_wait(exec::repeat_effect_until(std::move(input_snd))); + auto input_snd = ex::just() | ex::then([&p] { return p; }); + ex::sync_wait(exec::repeat_effect_until(std::move(input_snd))); } TEST_CASE( "repeat_effect_until forwards set_error calls of other types", "[adaptors][repeat_effect_until]") { - auto snd = just_error(std::string("error")) | exec::repeat_effect_until(); + auto snd = ex::just_error(std::string("error")) | exec::repeat_effect_until(); auto op = ex::connect(std::move(snd), expect_error_receiver{std::string("error")}); - stdexec::start(op); + ex::start(op); } TEST_CASE("repeat_effect_until forwards set_stopped calls", "[adaptors][repeat_effect_until]") { - auto snd = just_stopped() | exec::repeat_effect_until(); + auto snd = ex::just_stopped() | exec::repeat_effect_until(); auto op = ex::connect(std::move(snd), expect_stopped_receiver{}); - stdexec::start(op); + ex::start(op); } TEST_CASE( "running deeply recursing algo on repeat_effect_until doesn't blow the stack", "[adaptors][repeat_effect_until]") { int n = 1; - sender auto snd = exec::repeat_effect_until(just() | then([&n] { - ++n; - return n == 1'000'000; - })); - stdexec::sync_wait(std::move(snd)); + ex::sender auto snd = exec::repeat_effect_until(ex::just() | ex::then([&n] { + ++n; + return n == 1'000'000; + })); + ex::sync_wait(std::move(snd)); CHECK(n == 1'000'000); } TEST_CASE("repeat_effect_until works when changing threads", "[adaptors][repeat_effect_until]") { exec::static_thread_pool pool{2}; bool called{false}; - sender auto snd = exec::on(pool.get_scheduler(), ex::just() | ex::then([&] { - called = true; - return called; - }) | exec::repeat_effect_until()); - stdexec::sync_wait(std::move(snd)); + ex::sender auto snd = ex::on(pool.get_scheduler(), ex::just() | ex::then([&] { + called = true; + return called; + }) | exec::repeat_effect_until()); + ex::sync_wait(std::move(snd)); REQUIRE(called); } diff --git a/test/exec/test_repeat_n.cpp b/test/exec/test_repeat_n.cpp index 0cb236b85..4992d5778 100644 --- a/test/exec/test_repeat_n.cpp +++ b/test/exec/test_repeat_n.cpp @@ -124,7 +124,7 @@ namespace { TEST_CASE("repeat_n works when changing threads", "[adaptors][repeat_n]") { exec::static_thread_pool pool{2}; bool called{false}; - sender auto snd = exec::on(pool.get_scheduler(), ex::just() | ex::then([&] { + sender auto snd = stdexec::on(pool.get_scheduler(), ex::just() | ex::then([&] { called = true; }) | exec::repeat_n(10)); stdexec::sync_wait(std::move(snd)); diff --git a/test/exec/test_trampoline_scheduler.cpp b/test/exec/test_trampoline_scheduler.cpp index edd678c05..0550c011b 100644 --- a/test/exec/test_trampoline_scheduler.cpp +++ b/test/exec/test_trampoline_scheduler.cpp @@ -17,26 +17,23 @@ #include "../../include/exec/trampoline_scheduler.hpp" -#include "../../include/exec/on.hpp" -#include "../test_common/require_terminate.hpp" #include "../test_common/retry.hpp" #include -#include #include -using namespace stdexec; +namespace ex = stdexec; namespace { struct try_again { }; struct fails_alot { - using sender_concept = stdexec::sender_t; + using sender_concept = ex::sender_t; using __t = fails_alot; using __id = fails_alot; using completion_signatures = - stdexec::completion_signatures; + ex::completion_signatures; template struct operation { @@ -45,15 +42,15 @@ namespace { void start() & noexcept { if (counter_ == 0) { - stdexec::set_value(static_cast(rcvr_)); + ex::set_value(static_cast(rcvr_)); } else { - stdexec::set_error(static_cast(rcvr_), try_again{}); + ex::set_error(static_cast(rcvr_), try_again{}); } } }; - template Receiver> - friend auto tag_invoke(connect_t, fails_alot self, Receiver rcvr) -> operation { + template Receiver> + friend auto tag_invoke(ex::connect_t, fails_alot self, Receiver rcvr) -> operation { return {static_cast(rcvr), --*self.counter_}; } @@ -74,11 +71,10 @@ namespace { "running deeply recursing algo on trampoline_scheduler doesn't blow the stack", "[schedulers][trampoline_scheduler]") { - using stdexec::__sync_wait::__env; exec::trampoline_scheduler sched; - stdexec::run_loop loop; + ex::run_loop loop; - auto recurse_deeply = retry(exec::on(sched, fails_alot{})); - sync_wait(std::move(recurse_deeply)); + auto recurse_deeply = retry(ex::on(sched, fails_alot{})); + ex::sync_wait(std::move(recurse_deeply)); } } // namespace diff --git a/test/exec/test_type_async_scope.cpp b/test/exec/test_type_async_scope.cpp index 60f3f14fe..9cbc30db9 100644 --- a/test/exec/test_type_async_scope.cpp +++ b/test/exec/test_type_async_scope.cpp @@ -32,10 +32,10 @@ namespace { void expect_empty(exec::async_scope& scope) { ex::run_loop loop; ex::scheduler auto sch = loop.get_scheduler(); - CHECK_FALSE(stdexec::execute_may_block_caller(sch)); + CHECK_FALSE(ex::execute_may_block_caller(sch)); auto op = ex::connect( ex::then(scope.on_empty(), [&]() { loop.finish(); }), - expect_void_receiver{exec::make_env(stdexec::prop{ex::get_scheduler, sch})}); + expect_void_receiver{exec::make_env(ex::prop{ex::get_scheduler, sch})}); ex::start(op); loop.run(); } @@ -54,7 +54,7 @@ namespace { exec::async_scope scope; ex::sender auto begin = ex::schedule(sch); scope.spawn(begin); - stdexec::sync_wait(scope.on_empty()); + ex::sync_wait(scope.on_empty()); expect_empty(scope); } @@ -65,7 +65,7 @@ namespace { ex::sender auto nst = scope.nest(begin); (void) nst; } - stdexec::sync_wait(scope.on_empty()); + ex::sync_wait(scope.on_empty()); expect_empty(scope); } @@ -75,7 +75,7 @@ namespace { ex::sender auto nst = scope.nest(begin); auto op = ex::connect(std::move(nst), expect_void_receiver{}); ex::start(op); - stdexec::sync_wait(scope.on_empty()); + ex::sync_wait(scope.on_empty()); expect_empty(scope); } @@ -85,11 +85,11 @@ namespace { std::atomic_bool produced{false}; ex::sender auto begin = ex::schedule(sch); { - ex::sender auto ftr = scope.spawn_future(begin | stdexec::then([&]() { produced = true; })); + ex::sender auto ftr = scope.spawn_future(begin | ex::then([&]() { produced = true; })); (void) ftr; } - stdexec::sync_wait( - scope.on_empty() | stdexec::then([&]() { STDEXEC_ASSERT(produced.load()); })); + ex::sync_wait( + scope.on_empty() | ex::then([&]() { STDEXEC_ASSERT(produced.load()); })); expect_empty(scope); } @@ -98,12 +98,12 @@ namespace { exec::async_scope scope; std::atomic_bool produced{false}; ex::sender auto begin = ex::schedule(sch); - ex::sender auto ftr = scope.spawn_future(begin | stdexec::then([&]() { produced = true; })); - stdexec::sync_wait( - scope.on_empty() | stdexec::then([&]() { STDEXEC_ASSERT(produced.load()); })); + ex::sender auto ftr = scope.spawn_future(begin | ex::then([&]() { produced = true; })); + ex::sync_wait( + scope.on_empty() | ex::then([&]() { STDEXEC_ASSERT(produced.load()); })); auto op = ex::connect(std::move(ftr), expect_void_receiver{}); ex::start(op); - stdexec::sync_wait(scope.on_empty()); + ex::sync_wait(scope.on_empty()); expect_empty(scope); } @@ -113,7 +113,7 @@ namespace { ex::sender auto begin = ex::schedule(sch); ex::sender auto ftr = scope.spawn_future(scope.spawn_future(begin)); scope.request_stop(); - stdexec::sync_wait(ex::when_all(scope.on_empty(), std::move(ftr))); + ex::sync_wait(ex::when_all(scope.on_empty(), std::move(ftr))); // Verify the program finishes without crashing } } diff --git a/test/execpools/test_asio_thread_pool.cpp b/test/execpools/test_asio_thread_pool.cpp index 81b21ac54..c4be181ff 100644 --- a/test/execpools/test_asio_thread_pool.cpp +++ b/test/execpools/test_asio_thread_pool.cpp @@ -85,7 +85,7 @@ namespace { } // namespace TEST_CASE( - "exec::on works when changing threads with execpools::asio_thread_pool", + "stdexec::on works when changing threads with execpools::asio_thread_pool", "[adaptors][exec::starts_on]") { execpools::asio_thread_pool pool; auto pool_sched = pool.get_scheduler(); diff --git a/test/execpools/test_taskflow_thread_pool.cpp b/test/execpools/test_taskflow_thread_pool.cpp index fec77cd51..a85204622 100644 --- a/test/execpools/test_taskflow_thread_pool.cpp +++ b/test/execpools/test_taskflow_thread_pool.cpp @@ -82,7 +82,7 @@ namespace { } // namespace TEST_CASE( - "exec::on works when changing threads with execpools::taskflow_thread_pool", + "stdexec::on works when changing threads with execpools::taskflow_thread_pool", "[adaptors][exec::starts_on]") { execpools::taskflow_thread_pool pool; auto pool_sched = pool.get_scheduler(); diff --git a/test/execpools/test_tbb_thread_pool.cpp b/test/execpools/test_tbb_thread_pool.cpp index 91a74bfaa..2bc51bfd4 100644 --- a/test/execpools/test_tbb_thread_pool.cpp +++ b/test/execpools/test_tbb_thread_pool.cpp @@ -82,7 +82,7 @@ namespace { } // namespace TEST_CASE( - "exec::on works when changing threads with execpools::tbb_thread_pool", + "stdexec::on works when changing threads with execpools::tbb_thread_pool", "[adaptors][exec::starts_on]") { execpools::tbb_thread_pool pool; auto pool_sched = pool.get_scheduler(); diff --git a/test/rrd/async_scope.cpp b/test/rrd/async_scope.cpp index 70b75d49c..d8f1964f2 100644 --- a/test/rrd/async_scope.cpp +++ b/test/rrd/async_scope.cpp @@ -6,7 +6,6 @@ #include #include -#include #include using rl::nvar; @@ -27,11 +26,10 @@ struct drop_async_scope_future : rl::test_suite { std::atomic_bool produced{false}; ex::sender auto begin = ex::schedule(sch); { - ex::sender auto ftr = scope - .spawn_future(begin | stdexec::then([&]() { produced.store(true); })); + ex::sender auto ftr = scope.spawn_future(begin | ex::then([&]() { produced.store(true); })); (void) ftr; } - stdexec::sync_wait(scope.on_empty() | stdexec::then([&]() { RL_ASSERT(produced.load()); })); + ex::sync_wait(scope.on_empty() | ex::then([&]() { RL_ASSERT(produced.load()); })); } }; @@ -45,10 +43,9 @@ struct attach_async_scope_future : rl::test_suite exec::async_scope scope; std::atomic_bool produced{false}; ex::sender auto begin = ex::schedule(sch); - ex::sender auto ftr = scope - .spawn_future(begin | stdexec::then([&]() { produced.store(true); })); - ex::sender auto ftr_then = std::move(ftr) | stdexec::then([&] { RL_ASSERT(produced.load()); }); - stdexec::sync_wait(stdexec::when_all(scope.on_empty(), std::move(ftr_then))); + ex::sender auto ftr = scope.spawn_future(begin | ex::then([&]() { produced.store(true); })); + ex::sender auto ftr_then = std::move(ftr) | ex::then([&] { RL_ASSERT(produced.load()); }); + ex::sync_wait(ex::when_all(scope.on_empty(), std::move(ftr_then))); } }; @@ -69,17 +66,17 @@ struct async_scope_future_set_result : rl::test_suite& vals) { - while (b < e) - vals[b++] = static_cast(b); + for (;b < e; ++b) { + vals[b] = static_cast(b); + } }); auto op = ex::connect(std::move(snd), expect_value_receiver{vals_expected}); ex::start(op); @@ -596,7 +597,7 @@ namespace { auto snd = ex::transfer_just(sch) | ex::bulk(ex::par, n, [&counter](std::size_t idx) { counter[idx] = 0; }) | ex::bulk(ex::par, n, [&counter](std::size_t idx) { counter[idx]++; }); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); const std::size_t actual = static_cast( std::count(counter.begin(), counter.end(), 1)); @@ -624,7 +625,7 @@ namespace { counter[idx]++; } }); - auto [val] = stdexec::sync_wait(std::move(snd)).value(); + auto [val] = ex::sync_wait(std::move(snd)).value(); CHECK(val == 42); @@ -649,7 +650,7 @@ namespace { n, [](std::size_t idx, std::vector& vals) { vals[idx] = static_cast(idx); }) | ex::bulk(ex::par, n, [](std::size_t idx, std::vector& vals) { ++vals[idx]; }); - auto [vals_actual] = stdexec::sync_wait(std::move(snd)).value(); + auto [vals_actual] = ex::sync_wait(std::move(snd)).value(); CHECK(vals_actual == vals_expected); } @@ -661,7 +662,7 @@ namespace { auto snd = ex::transfer_just(sch) | ex::bulk(ex::par, n, [](int) { throw std::runtime_error("bulk"); }); - CHECK_THROWS_AS(stdexec::sync_wait(std::move(snd)), std::runtime_error); + CHECK_THROWS_AS(ex::sync_wait(std::move(snd)), std::runtime_error); } #endif // !STDEXEC_STD_NO_EXCEPTIONS() @@ -670,13 +671,13 @@ namespace { std::vector counters_1(n, 0); std::vector counters_2(n, 0); - stdexec::sender auto snd = stdexec::when_all( - stdexec::schedule(sch) - | stdexec::bulk(ex::par, n, [&](std::size_t id) { counters_1[id]++; }), - stdexec::schedule(sch) - | stdexec::bulk(ex::par, n, [&](std::size_t id) { counters_2[id]++; })); + ex::sender auto snd = ex::when_all( + ex::schedule(sch) + | ex::bulk(ex::par, n, [&](std::size_t id) { counters_1[id]++; }), + ex::schedule(sch) + | ex::bulk(ex::par, n, [&](std::size_t id) { counters_2[id]++; })); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); CHECK(std::count(counters_1.begin(), counters_1.end(), 1) == static_cast(n)); CHECK(std::count(counters_2.begin(), counters_2.end(), 1) == static_cast(n)); @@ -703,7 +704,7 @@ namespace { while (b < e) counter[b++]++; }); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); const std::size_t actual = static_cast( std::count(counter.begin(), counter.end(), 1)); @@ -733,7 +734,7 @@ namespace { counter[b++]++; } }); - auto [val] = stdexec::sync_wait(std::move(snd)).value(); + auto [val] = ex::sync_wait(std::move(snd)).value(); CHECK(val == 42); @@ -766,7 +767,7 @@ namespace { while (b < e) ++vals[b++]; }); - auto [vals_actual] = stdexec::sync_wait(std::move(snd)).value(); + auto [vals_actual] = ex::sync_wait(std::move(snd)).value(); CHECK(vals_actual == vals_expected); } @@ -779,7 +780,7 @@ namespace { throw std::runtime_error("bulk_chunked"); }); - CHECK_THROWS_AS(stdexec::sync_wait(std::move(snd)), std::runtime_error); + CHECK_THROWS_AS(ex::sync_wait(std::move(snd)), std::runtime_error); } #endif // !STDEXEC_STD_NO_EXCEPTIONS() @@ -788,22 +789,22 @@ namespace { std::vector counters_1(n, 0); std::vector counters_2(n, 0); - stdexec::sender auto snd = stdexec::when_all( - stdexec::schedule(sch) - | stdexec::bulk_chunked( + ex::sender auto snd = ex::when_all( + ex::schedule(sch) + | ex::bulk_chunked( ex::par, n, [&](std::size_t b, std::size_t e) { while (b < e) counters_1[b++]++; }), - stdexec::schedule(sch) - | stdexec::bulk_chunked(ex::par, n, [&](std::size_t b, std::size_t e) { + ex::schedule(sch) + | ex::bulk_chunked(ex::par, n, [&](std::size_t b, std::size_t e) { while (b < e) counters_2[b++]++; })); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); CHECK(std::count(counters_1.begin(), counters_1.end(), 1) == static_cast(n)); CHECK(std::count(counters_2.begin(), counters_2.end(), 1) == static_cast(n)); @@ -821,7 +822,7 @@ namespace { auto snd = ex::transfer_just(sch) | ex::bulk_unchunked(ex::par, n, [&counter](std::size_t idx) { counter[idx] = 0; }) | ex::bulk_unchunked(ex::par, n, [&counter](std::size_t idx) { counter[idx]++; }); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); const std::size_t actual = static_cast( std::count(counter.begin(), counter.end(), 1)); @@ -848,7 +849,7 @@ namespace { counter[idx]++; } }); - auto [val] = stdexec::sync_wait(std::move(snd)).value(); + auto [val] = ex::sync_wait(std::move(snd)).value(); CHECK(val == 42); @@ -871,7 +872,7 @@ namespace { | ex::bulk_unchunked(ex::par, n, [](std::size_t idx, std::vector& vals) { vals[idx] = static_cast(idx); }) | ex::bulk_unchunked(ex::par, n, [](std::size_t idx, std::vector& vals) { ++vals[idx]; }); - auto [vals_actual] = stdexec::sync_wait(std::move(snd)).value(); + auto [vals_actual] = ex::sync_wait(std::move(snd)).value(); CHECK(vals_actual == vals_expected); } @@ -883,7 +884,7 @@ namespace { auto snd = ex::transfer_just(sch) | ex::bulk_unchunked(ex::par, n, [](int) { throw std::runtime_error("bulk_unchunked"); }); - CHECK_THROWS_AS(stdexec::sync_wait(std::move(snd)), std::runtime_error); + CHECK_THROWS_AS(ex::sync_wait(std::move(snd)), std::runtime_error); } #endif // !STDEXEC_STD_NO_EXCEPTIONS() @@ -892,13 +893,13 @@ namespace { std::vector counters_1(n, 0); std::vector counters_2(n, 0); - stdexec::sender auto snd = stdexec::when_all( - stdexec::schedule(sch) - | stdexec::bulk_unchunked(ex::par, n, [&](std::size_t id) { counters_1[id]++; }), - stdexec::schedule(sch) - | stdexec::bulk_unchunked(ex::par, n, [&](std::size_t id) { counters_2[id]++; })); + ex::sender auto snd = ex::when_all( + ex::schedule(sch) + | ex::bulk_unchunked(ex::par, n, [&](std::size_t id) { counters_1[id]++; }), + ex::schedule(sch) + | ex::bulk_unchunked(ex::par, n, [&](std::size_t id) { counters_2[id]++; })); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); CHECK(std::count(counters_1.begin(), counters_1.end(), 1) == static_cast(n)); CHECK(std::count(counters_2.begin(), counters_2.end(), 1) == static_cast(n)); @@ -918,7 +919,7 @@ namespace { }; auto snd = ex::just() | ex::continues_on(sch) | ex::bulk(ex::par, tids.size(), fun); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); // All the work should not have run on the same thread const auto actual = static_cast(std::count(tids.begin(), tids.end(), tids[0])); @@ -945,7 +946,7 @@ namespace { }; auto snd = ex::just() | ex::continues_on(sch) | ex::bulk_chunked(ex::par, tids.size(), fun); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); // All the work should not have run on the same thread const auto actual = static_cast(std::count(tids.begin(), tids.end(), tids[0])); @@ -968,7 +969,7 @@ namespace { }; auto snd = ex::just() | ex::bulk(ex::par, tids.size(), fun); - stdexec::sync_wait(stdexec::starts_on(sch, std::move(snd))); + ex::sync_wait(ex::starts_on(sch, std::move(snd))); // All the work should not have run on the same thread const auto actual = static_cast(std::count(tids.begin(), tids.end(), tids[0])); @@ -995,7 +996,7 @@ namespace { }; auto snd = ex::just() | ex::bulk_chunked(ex::par, tids.size(), fun); - stdexec::sync_wait(stdexec::starts_on(sch, std::move(snd))); + ex::sync_wait(ex::starts_on(sch, std::move(snd))); // All the work should not have run on the same thread const auto actual = static_cast(std::count(tids.begin(), tids.end(), tids[0])); @@ -1043,7 +1044,7 @@ namespace { }; auto snd = ex::just() | ex::continues_on(sch) | ex::bulk(policy, tids.size(), fun); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); std::sort(tids.begin(), tids.end()); return static_cast(std::unique(tids.begin(), tids.end()) - tids.begin()); @@ -1079,7 +1080,7 @@ namespace { }; auto snd = ex::just() | ex::continues_on(sch) | ex::bulk_chunked(policy, tids.size(), fun); - stdexec::sync_wait(std::move(snd)); + ex::sync_wait(std::move(snd)); std::sort(tids.begin(), tids.end()); return static_cast(std::unique(tids.begin(), tids.end()) - tids.begin()); @@ -1117,7 +1118,7 @@ namespace { // The customization will return a different value basic_inline_scheduler sched; auto snd = ex::just(std::string{"hello"}) - | exec::on(sched, ex::bulk(ex::par, 1, [&called](int, std::string) { + | ex::on(sched, ex::bulk(ex::par, 1, [&called](int, std::string) { called = true; })); wait_for_value(std::move(snd), std::string{"hijacked"}); diff --git a/test/stdexec/algos/adaptors/test_let_error.cpp b/test/stdexec/algos/adaptors/test_let_error.cpp index d01c5ba09..0c664243d 100644 --- a/test/stdexec/algos/adaptors/test_let_error.cpp +++ b/test/stdexec/algos/adaptors/test_let_error.cpp @@ -306,7 +306,7 @@ namespace { | ex::let_error([](std::exception_ptr) { return ex::just_error(std::string{"err"}); })); check_err_types>( ex::transfer_just(sched3) - | ex::let_error([](stdexec::__one_of auto) { + | ex::let_error([](ex::__one_of auto) { return ex::just_error(std::string{"err"}); })); @@ -317,7 +317,7 @@ namespace { ex::transfer_just(sched2) | ex::let_error([](std::exception_ptr) { return ex::just(); })); check_err_types>( ex::transfer_just(sched3) - | ex::let_error([](stdexec::__one_of auto) { return ex::just(); })); + | ex::let_error([](ex::__one_of auto) { return ex::just(); })); } TEST_CASE("let_error keeps sends_stopped from input sender", "[adaptors][let_error]") { diff --git a/test/exec/test_on.cpp b/test/stdexec/algos/adaptors/test_on.cpp similarity index 65% rename from test/exec/test_on.cpp rename to test/stdexec/algos/adaptors/test_on.cpp index ba0f36fd9..d041ef54a 100644 --- a/test/exec/test_on.cpp +++ b/test/stdexec/algos/adaptors/test_on.cpp @@ -39,31 +39,31 @@ namespace { using _env_with_sched_t = decltype(_make_env_with_sched()); - TEST_CASE("exec::on returns a sender", "[adaptors][exec::on]") { - auto snd = exec::on(inline_scheduler{}, ex::just(13)); + TEST_CASE("stdexec::on returns a sender", "[adaptors][stdexec::on]") { + auto snd = ex::on(inline_scheduler{}, ex::just(13)); static_assert(ex::sender); (void) snd; } - TEST_CASE("exec::on with environment returns a sender", "[adaptors][exec::on]") { - auto snd = exec::on(inline_scheduler{}, ex::just(13)); + TEST_CASE("stdexec::on with environment returns a sender", "[adaptors][stdexec::on]") { + auto snd = ex::on(inline_scheduler{}, ex::just(13)); static_assert(ex::sender_in); (void) snd; } - TEST_CASE("exec::on simple example", "[adaptors][exec::on]") { - auto snd = exec::on(inline_scheduler{}, ex::just(13)); + TEST_CASE("stdexec::on simple example", "[adaptors][stdexec::on]") { + auto snd = ex::on(inline_scheduler{}, ex::just(13)); auto op = ex::connect(std::move(snd), expect_value_receiver{env_tag{}, _make_env_with_sched(), 13}); ex::start(op); // The receiver checks if we receive the right value } - TEST_CASE("exec::on calls the receiver when the scheduler dictates", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on calls the receiver when the scheduler dictates", "[adaptors][stdexec::on]") { int recv_value{0}; impulse_scheduler sched; auto env = _make_env_with_sched(); - auto snd = exec::on(sched, ex::just(13)); + auto snd = ex::on(sched, ex::just(13)); auto op = ex::connect(std::move(snd), expect_value_receiver_ex{env, recv_value}); ex::start(op); // Up until this point, the scheduler didn't start any task; no effect expected @@ -74,7 +74,7 @@ namespace { CHECK(recv_value == 13); } - TEST_CASE("exec::on calls the given sender when the scheduler dictates", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on calls the given sender when the scheduler dictates", "[adaptors][stdexec::on]") { bool called{false}; auto snd_base = ex::just() | ex::then([&]() -> int { called = true; @@ -84,7 +84,7 @@ namespace { int recv_value{0}; impulse_scheduler sched; auto env = _make_env_with_sched(); - auto snd = exec::on(sched, std::move(snd_base)); + auto snd = ex::on(sched, std::move(snd_base)); auto op = ex::connect(std::move(snd), expect_value_receiver_ex{env, recv_value}); ex::start(op); // Up until this point, the scheduler didn't start any task @@ -99,100 +99,100 @@ namespace { CHECK(recv_value == 19); } - TEST_CASE("exec::on works when changing threads", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on works when changing threads", "[adaptors][stdexec::on]") { exec::static_thread_pool pool{2}; bool called{false}; // launch some work on the thread pool - ex::sender auto snd = exec::on(pool.get_scheduler(), ex::just()) + ex::sender auto snd = ex::on(pool.get_scheduler(), ex::just()) | ex::then([&] { called = true; }) | _with_scheduler(); stdexec::sync_wait(std::move(snd)); // the work should be executed REQUIRE(called); } - TEST_CASE("exec::on can be called with rvalue ref scheduler", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on can be called with rvalue ref scheduler", "[adaptors][stdexec::on]") { auto env = _make_env_with_sched(); - auto snd = exec::on(inline_scheduler{}, ex::just(13)); + auto snd = ex::on(inline_scheduler{}, ex::just(13)); auto op = ex::connect(std::move(snd), expect_value_receiver{env_tag{}, env, 13}); ex::start(op); // The receiver checks if we receive the right value } - TEST_CASE("exec::on can be called with const ref scheduler", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on can be called with const ref scheduler", "[adaptors][stdexec::on]") { auto env = _make_env_with_sched(); const inline_scheduler sched; - auto snd = exec::on(sched, ex::just(13)); + auto snd = ex::on(sched, ex::just(13)); auto op = ex::connect(std::move(snd), expect_value_receiver{env_tag{}, env, 13}); ex::start(op); // The receiver checks if we receive the right value } - TEST_CASE("exec::on can be called with ref scheduler", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on can be called with ref scheduler", "[adaptors][stdexec::on]") { auto env = _make_env_with_sched(); inline_scheduler sched; - auto snd = exec::on(sched, ex::just(13)); + auto snd = ex::on(sched, ex::just(13)); auto op = ex::connect(std::move(snd), expect_value_receiver{env_tag{}, env, 13}); ex::start(op); // The receiver checks if we receive the right value } - TEST_CASE("exec::on forwards set_error calls", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on forwards set_error calls", "[adaptors][stdexec::on]") { auto env = _make_env_with_sched(); error_scheduler sched{std::exception_ptr{}}; - auto snd = exec::on(sched, ex::just(13)); + auto snd = ex::on(sched, ex::just(13)); auto op = ex::connect(std::move(snd), expect_error_receiver{env, std::exception_ptr{}}); ex::start(op); // The receiver checks if we receive an error } - TEST_CASE("exec::on forwards set_error calls of other types", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on forwards set_error calls of other types", "[adaptors][stdexec::on]") { auto env = _make_env_with_sched(); error_scheduler sched{std::string{"error"}}; - auto snd = exec::on(sched, ex::just(13)); + auto snd = ex::on(sched, ex::just(13)); auto op = ex::connect(std::move(snd), expect_error_receiver{env, std::string{"error"}}); ex::start(op); // The receiver checks if we receive an error } - TEST_CASE("exec::on forwards set_stopped calls", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on forwards set_stopped calls", "[adaptors][stdexec::on]") { auto env = _make_env_with_sched(); stopped_scheduler sched{}; - auto snd = exec::on(sched, ex::just(13)); + auto snd = ex::on(sched, ex::just(13)); auto op = ex::connect(std::move(snd), expect_stopped_receiver{env}); ex::start(op); // The receiver checks if we receive the stopped signal } TEST_CASE( - "exec::on has the values_type corresponding to the given values", - "[adaptors][exec::on]") { + "stdexec::on has the values_type corresponding to the given values", + "[adaptors][stdexec::on]") { inline_scheduler sched{}; - check_val_types>>(exec::on(sched, ex::just(1)) | _with_scheduler()); + check_val_types>>(ex::on(sched, ex::just(1)) | _with_scheduler()); check_val_types>>( - exec::on(sched, ex::just(3, 0.14)) | _with_scheduler()); + ex::on(sched, ex::just(3, 0.14)) | _with_scheduler()); check_val_types>>( - exec::on(sched, ex::just(3, 0.14, std::string{"pi"})) | _with_scheduler()); + ex::on(sched, ex::just(3, 0.14, std::string{"pi"})) | _with_scheduler()); } - TEST_CASE("exec::on keeps error_types from scheduler's sender", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on keeps error_types from scheduler's sender", "[adaptors][stdexec::on]") { inline_scheduler sched1{}; error_scheduler sched2{}; error_scheduler sched3{43}; - check_err_types>(exec::on(sched1, ex::just(1)) | _with_scheduler()); + check_err_types>(ex::on(sched1, ex::just(1)) | _with_scheduler()); check_err_types>( - exec::on(sched2, ex::just(2)) | _with_scheduler()); - check_err_types>(exec::on(sched3, ex::just(3)) | _with_scheduler()); + ex::on(sched2, ex::just(2)) | _with_scheduler()); + check_err_types>(ex::on(sched3, ex::just(3)) | _with_scheduler()); } - TEST_CASE("exec::on keeps sends_stopped from scheduler's sender", "[adaptors][exec::on]") { + TEST_CASE("stdexec::on keeps sends_stopped from scheduler's sender", "[adaptors][stdexec::on]") { inline_scheduler sched1{}; error_scheduler sched2{}; stopped_scheduler sched3{}; - check_sends_stopped(exec::on(sched1, ex::just(1)) | _with_scheduler()); - check_sends_stopped(exec::on(sched2, ex::just(2)) | _with_scheduler()); - check_sends_stopped(exec::on(sched3, ex::just(3)) | _with_scheduler()); + check_sends_stopped(ex::on(sched1, ex::just(1)) | _with_scheduler()); + check_sends_stopped(ex::on(sched2, ex::just(2)) | _with_scheduler()); + check_sends_stopped(ex::on(sched3, ex::just(3)) | _with_scheduler()); } } // namespace diff --git a/test/exec/test_on2.cpp b/test/stdexec/algos/adaptors/test_on2.cpp similarity index 88% rename from test/exec/test_on2.cpp rename to test/stdexec/algos/adaptors/test_on2.cpp index 435e9500b..466439dc5 100644 --- a/test/exec/test_on2.cpp +++ b/test/stdexec/algos/adaptors/test_on2.cpp @@ -28,12 +28,12 @@ namespace { template inline auto _with_scheduler(Sched sched = {}) { - return exec::write_env(stdexec::prop{ex::get_scheduler, std::move(sched)}); + return exec::write_env(ex::prop{ex::get_scheduler, std::move(sched)}); } TEST_CASE( - "exec::on transitions back to the receiver's scheduler when completing with a value", - "[adaptors][exec::on]") { + "stdexec::on transitions back to the receiver's scheduler when completing with a value", + "[adaptors][stdexec::on]") { bool called{false}; auto snd_base = ex::just() | ex::then([&]() -> int { called = true; @@ -43,7 +43,7 @@ namespace { int recv_value{0}; impulse_scheduler sched1; impulse_scheduler sched2; - auto snd = exec::on(sched1, std::move(snd_base)) | _with_scheduler(sched2); + auto snd = ex::on(sched1, std::move(snd_base)) | _with_scheduler(sched2); auto op = ex::connect(std::move(snd), expect_value_receiver_ex{recv_value}); ex::start(op); // Up until this point, the scheduler didn't start any task @@ -65,8 +65,8 @@ namespace { } TEST_CASE( - "exec::on transitions back to the receiver's scheduler when completing with an error", - "[adaptors][exec::on]") { + "stdexec::on transitions back to the receiver's scheduler when completing with an error", + "[adaptors][stdexec::on]") { bool called{false}; auto snd_base = ex::just() | ex::let_value([&]() { called = true; @@ -76,7 +76,7 @@ namespace { int recv_error{0}; impulse_scheduler sched1; impulse_scheduler sched2; - auto snd = exec::on(sched1, std::move(snd_base)) | _with_scheduler(sched2); + auto snd = ex::on(sched1, std::move(snd_base)) | _with_scheduler(sched2); auto op = ex::connect(std::move(snd), expect_error_receiver_ex{recv_error}); ex::start(op); // Up until this point, the scheduler didn't start any task @@ -99,7 +99,7 @@ namespace { TEST_CASE( "inner on transitions back to outer on's scheduler when completing with a value", - "[adaptors][exec::on]") { + "[adaptors][stdexec::on]") { bool called{false}; auto snd_base = ex::just() | ex::then([&]() -> int { called = true; @@ -110,7 +110,7 @@ namespace { impulse_scheduler sched1; impulse_scheduler sched2; impulse_scheduler sched3; - auto snd = exec::on(sched1, exec::on(sched2, std::move(snd_base))) | _with_scheduler(sched3); + auto snd = ex::on(sched1, ex::on(sched2, std::move(snd_base))) | _with_scheduler(sched3); auto op = ex::connect(std::move(snd), expect_value_receiver_ex{recv_value}); ex::start(op); // Up until this point, the scheduler didn't start any task @@ -150,7 +150,7 @@ namespace { TEST_CASE( "inner on transitions back to outer on's scheduler when completing with an error", - "[adaptors][exec::on]") { + "[adaptors][stdexec::on]") { bool called{false}; auto snd_base = ex::just() | ex::let_value([&]() { called = true; @@ -161,7 +161,7 @@ namespace { impulse_scheduler sched1; impulse_scheduler sched2; impulse_scheduler sched3; - auto snd = exec::on(sched1, exec::on(sched2, std::move(snd_base))) | _with_scheduler(sched3); + auto snd = ex::on(sched1, ex::on(sched2, std::move(snd_base))) | _with_scheduler(sched3); auto op = ex::connect(std::move(snd), expect_error_receiver_ex{recv_error}); ex::start(op); // Up until this point, the scheduler didn't start any task @@ -200,8 +200,8 @@ namespace { } TEST_CASE( - "exec::on(closure) transitions onto and back off of the scheduler when completing with a value", - "[adaptors][exec::on]") { + "ex::on(closure) transitions onto and back off of the scheduler when completing with a value", + "[adaptors][stdexec::on]") { bool called{false}; auto closure = ex::then([&]() -> int { called = true; @@ -211,7 +211,7 @@ namespace { int recv_value{0}; impulse_scheduler sched1; impulse_scheduler sched2; - auto snd = ex::just() | exec::on(sched1, std::move(closure)) | _with_scheduler(sched2); + auto snd = ex::just() | ex::on(sched1, std::move(closure)) | _with_scheduler(sched2); auto op = ex::connect(std::move(snd), expect_value_receiver_ex{recv_value}); ex::start(op); // Up until this point, the scheduler didn't start any task @@ -233,9 +233,9 @@ namespace { } TEST_CASE( - "exec::on(closure) transitions onto and back off of the scheduler when completing with " + "ex::on(closure) transitions onto and back off of the scheduler when completing with " "an error", - "[adaptors][exec::on]") { + "[adaptors][stdexec::on]") { bool called{false}; auto closure = ex::let_value([&]() { called = true; @@ -245,7 +245,7 @@ namespace { int recv_error{0}; impulse_scheduler sched1; impulse_scheduler sched2; - auto snd = ex::just() | exec::on(sched1, std::move(closure)) | _with_scheduler(sched2); + auto snd = ex::just() | ex::on(sched1, std::move(closure)) | _with_scheduler(sched2); auto op = ex::connect(std::move(snd), expect_error_receiver_ex{recv_error}); ex::start(op); // Up until this point, the scheduler didn't start any task @@ -268,7 +268,7 @@ namespace { TEST_CASE( "inner on(closure) transitions back to outer on's scheduler when completing with a value", - "[adaptors][exec::on]") { + "[adaptors][stdexec::on]") { bool called{false}; auto closure = ex::then([&](int i) -> int { called = true; @@ -279,7 +279,7 @@ namespace { impulse_scheduler sched1; impulse_scheduler sched2; impulse_scheduler sched3; - auto snd = exec::on(sched1, ex::just(19)) | exec::on(sched2, std::move(closure)) + auto snd = ex::on(sched1, ex::just(19)) | ex::on(sched2, std::move(closure)) | _with_scheduler(sched3); auto op = ex::connect(std::move(snd), expect_value_receiver_ex{recv_value}); ex::start(op); @@ -320,7 +320,7 @@ namespace { TEST_CASE( "inner on(closure) transitions back to outer on's scheduler when completing with an error", - "[adaptors][exec::on]") { + "[adaptors][stdexec::on]") { bool called{false}; auto closure = ex::let_value([&](int i) { called = true; @@ -331,7 +331,7 @@ namespace { impulse_scheduler sched1; impulse_scheduler sched2; impulse_scheduler sched3; - auto snd = exec::on(sched1, ex::just(19)) | exec::on(sched2, std::move(closure)) + auto snd = ex::on(sched1, ex::just(19)) | ex::on(sched2, std::move(closure)) | _with_scheduler(sched3); auto op = ex::connect(std::move(snd), expect_error_receiver_ex{recv_error}); ex::start(op); diff --git a/test/exec/test_on3.cpp b/test/stdexec/algos/adaptors/test_on3.cpp similarity index 76% rename from test/exec/test_on3.cpp rename to test/stdexec/algos/adaptors/test_on3.cpp index 85daabd0f..8d81f5c86 100644 --- a/test/exec/test_on3.cpp +++ b/test/stdexec/algos/adaptors/test_on3.cpp @@ -86,42 +86,42 @@ namespace { static const auto probe_env = probe_env_t{}; - static const auto env = exec::make_env(stdexec::prop{ex::get_scheduler, inline_scheduler{}}); + static const auto env = exec::make_env(ex::prop{ex::get_scheduler, inline_scheduler{}}); - TEST_CASE("Can pass exec::on sender to start_detached", "[adaptors][exec::on]") { - ex::start_detached(exec::on(inline_scheduler{}, ex::just()), env); + TEST_CASE("Can pass stdexec::on sender to start_detached", "[adaptors][stdexec::on]") { + ex::start_detached(ex::on(inline_scheduler{}, ex::just()), env); } - TEST_CASE("Can pass exec::on sender to split", "[adaptors][exec::on]") { - auto snd = ex::split(exec::on(inline_scheduler{}, ex::just()), env); + TEST_CASE("Can pass stdexec::on sender to split", "[adaptors][stdexec::on]") { + auto snd = ex::split(ex::on(inline_scheduler{}, ex::just()), env); (void) snd; } - TEST_CASE("Can pass exec::on sender to ensure_started", "[adaptors][exec::on]") { - auto snd = ex::ensure_started(exec::on(inline_scheduler{}, ex::just()), env); + TEST_CASE("Can pass stdexec::on sender to ensure_started", "[adaptors][stdexec::on]") { + auto snd = ex::ensure_started(ex::on(inline_scheduler{}, ex::just()), env); (void) snd; } - TEST_CASE("Can pass exec::on sender to async_scope::spawn", "[adaptors][exec::on]") { + TEST_CASE("Can pass stdexec::on sender to async_scope::spawn", "[adaptors][stdexec::on]") { exec::async_scope scope; impulse_scheduler sched; - scope.spawn(exec::on(sched, ex::just()), env); + scope.spawn(ex::on(sched, ex::just()), env); sched.start_next(); ex::sync_wait(scope.on_empty()); } - TEST_CASE("Can pass exec::on sender to async_scope::spawn_future", "[adaptors][exec::on]") { + TEST_CASE("Can pass stdexec::on sender to async_scope::spawn_future", "[adaptors][stdexec::on]") { exec::async_scope scope; impulse_scheduler sched; - auto fut = scope.spawn_future(exec::on(sched, ex::just(42)), env); + auto fut = scope.spawn_future(ex::on(sched, ex::just(42)), env); sched.start_next(); auto [i] = ex::sync_wait(std::move(fut)).value(); CHECK(i == 42); ex::sync_wait(scope.on_empty()); } - TEST_CASE("exec::on updates the current scheduler in the receiver", "[adaptors][exec::on]") { - auto snd = ex::get_scheduler() | exec::on(inline_scheduler{}, probe_env()) + TEST_CASE("stdexec::on updates the current scheduler in the receiver", "[adaptors][stdexec::on]") { + auto snd = ex::get_scheduler() | ex::on(inline_scheduler{}, probe_env()) | ex::then([](Env) noexcept { using Sched = ex::__call_result_t; static_assert(ex::same_as); diff --git a/test/stdexec/algos/adaptors/test_then.cpp b/test/stdexec/algos/adaptors/test_then.cpp index 8b79b24e0..44684f1fe 100644 --- a/test/stdexec/algos/adaptors/test_then.cpp +++ b/test/stdexec/algos/adaptors/test_then.cpp @@ -190,7 +190,7 @@ namespace { // The customization will return a different value basic_inline_scheduler sched; auto snd = ex::just(std::string{"hello"}) - | exec::on(sched, ex::then([](std::string x) { return x + ", world"; })) + | ex::on(sched, ex::then([](std::string x) { return x + ", world"; })) | exec::write_env(stdexec::prop{ex::get_scheduler, inline_scheduler()}); wait_for_value(std::move(snd), std::string{"ciao"}); } diff --git a/test/stdexec/algos/consumers/test_start_detached.cpp b/test/stdexec/algos/consumers/test_start_detached.cpp index 59a8009d4..a36a7e12e 100644 --- a/test/stdexec/algos/consumers/test_start_detached.cpp +++ b/test/stdexec/algos/consumers/test_start_detached.cpp @@ -93,7 +93,7 @@ namespace { } struct custom_sender { - using sender_concept = stdexec::sender_t; + using sender_concept = ex::sender_t; using __t = custom_sender; using __id = custom_sender; using completion_signatures = ex::completion_signatures; @@ -180,7 +180,7 @@ namespace { // NOT TO SPEC TEST_CASE("start_detached can be customized on scheduler", "[consumers][start_detached]") { bool called = false; - ex::start_detached(ex::just(), stdexec::prop{ex::get_scheduler, custom_scheduler{&called}}); + ex::start_detached(ex::just(), ex::prop{ex::get_scheduler, custom_scheduler{&called}}); CHECK(called); } @@ -226,35 +226,35 @@ namespace { std::pmr::polymorphic_allocator alloc(&res); ex::start_detached( ex::just() | ex::then([&] { called = true; }), - exec::make_env(stdexec::prop{ex::get_allocator, alloc})); + exec::make_env(ex::prop{ex::get_allocator, alloc})); CHECK(called); CHECK(res.get_count() == 1); CHECK(res.get_alive() == 0); } #endif - TEST_CASE("exec::on can be passed to start_detached", "[adaptors][exec::on]") { + TEST_CASE("ex::on can be passed to start_detached", "[adaptors][ex::on]") { ex::run_loop loop; auto sch = loop.get_scheduler(); auto snd = ex::get_scheduler() | ex::let_value([](auto sched) { static_assert(ex::same_as); return ex::starts_on(sched, ex::just()); }); - ex::start_detached(ex::v2::on(sch, std::move(snd))); + ex::start_detached(ex::on(sch, std::move(snd))); loop.finish(); loop.run(); } struct env { }; - TEST_CASE("exec::on can be passed to start_detached with env", "[adaptors][exec::on]") { + TEST_CASE("ex::on can be passed to start_detached with env", "[adaptors][ex::on]") { ex::run_loop loop; auto sch = loop.get_scheduler(); auto snd = ex::get_scheduler() | ex::let_value([](auto sched) { static_assert(ex::same_as); return ex::starts_on(sched, ex::just()); }); - ex::start_detached(ex::v2::on(sch, std::move(snd)), env{}); + ex::start_detached(ex::on(sch, std::move(snd)), env{}); loop.finish(); loop.run(); }