cppcoro icon indicating copy to clipboard operation
cppcoro copied to clipboard

schedule_on demotes shared_task to task

Open invexed opened this issue 4 years ago • 0 comments

As the following example demonstrates, cppcoro::shared_tasks become cppcoro::tasks when propagating through cppcoro::schedule_on. Is this intended behaviour?

auto f() -> cppcoro::shared_task<int>
{
    co_return 0;
}

auto tp = cppcoro::static_thread_pool{};
auto g = cppcoro::schedule_on(tp, f()); // g is a cppcoro::task<int&>

https://godbolt.org/z/e3oKBG

invexed avatar May 28 '20 15:05 invexed