generated from bemanproject/exemplar
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hi,
I've recently been integrating this task implementation into a project which already used a different sender-based coroutine implementation. In doing so, I've come across a number or issues, some of which are related to the specification directly. I've omitted anything already present in P3796R0.
promise_type::return_value()should probably have a default template parameter to supportco_return {...}, i.e.:
template<class V = T>
void return_value(V&& value);
promise_type::await_transform(change_coroutine_scheduler): the spec usesexchange(SCHED(*this), scheduler_type(sch.scheduler)), but schedulers aren't guaranteed to be move-assignable. Is the intent to disallow such schedulers?task::connect()(andtask::as_awaitable()in this implementation) should be rvalue-ref-qualified because they movehandletask_scheduler::ts-sender::connectshould probably be rvalue-ref qualified, because there is no guarantee that the wrapped scheduler's sender isconst &-connectable. Also, perhaps the spec should sayconnect(std::move(SENDER(*this)), std::move(r))(addingstd::move()around the wrapped sender)?as_awaitable::result(andresult_type::resultin this implementation): is it a good idea to usestd::monostateas an "empty" type. What if the user wants to have their value type bestd::monostate? (I know this is a weird edge case, but I actually came across it).
There are also a number of issues with this implementation specifically. I can create a separate issue for them if that would be helpful.
Metadata
Metadata
Assignees
Labels
No labels