Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion include/exec/static_thread_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@ namespace experimental::execution
struct opstate_base_with_receiver : opstate_base<Range>
{
explicit opstate_base_with_receiver(Range range, _static_thread_pool& pool, Receiver rcvr)
: opstate_base<Range>{range, pool}
: opstate_base<Range>{std::move(range), pool}
, rcvr_(static_cast<Receiver&&>(rcvr))
{}

Expand Down
13 changes: 13 additions & 0 deletions test/exec/test_static_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ TEST_CASE("schedule_all on static_thread_pool handles empty ranges", "[types][st
CHECK(ex::sync_wait(std::move(sender)));
}

TEST_CASE("schedule_all on static_thread_pool accepts move-only ranges",
"[types][static_thread_pool]")
{
exec::static_thread_pool pool{1};
int sum = 0;
auto sender = exec::schedule_all(pool, std::views::all(std::vector<int>{1, 2, 3}))
| exec::transform_each(ex::then([&sum](int value) noexcept { sum += value; }))
| exec::ignore_all_values();

CHECK(ex::sync_wait(std::move(sender)));
CHECK(sum == 6);
}

#if !STDEXEC_NO_STDCPP_EXCEPTIONS()
TEST_CASE("schedule_all on static_thread_pool sends errors from set_next",
"[types][static_thread_pool]")
Expand Down
Loading