Title
co_await change_coroutine_scheduler(s) requires assignable
Status
nad
Section
[task.promise]
Submitter
Dietmar Kühl

Created on 2025-08-31.00:00:00 last changed 1 month ago

Messages

Date: 2025-10-27.09:58:11

Proposed resolution:

Change the wording in [task.promise] paragraph 11 to avoid the use of std::exchange and transfer the using construction:

template<class Sch>
  auto await_transform(change_coroutine_scheduler<Sch> sch) noexcept;

-11- Effects: Equivalent to:

return await_transform(just(exchange(SCHED(*this), scheduler_type(sch.scheduler))), *this);
auto* s{address_of(SCHED(*this))};
auto rc{std::move(*s)};
s->~scheduler_type();
new(s) scheduler_type(std::move(sch));
return std::move(rc);

Date: 2025-12-10.00:00:00

[ 2025-12-10 Status changed: Tentatively NAD → NAD. ]

Date: 2025-10-15.00:00:00

[ 2025-10-23; Reflector poll. Status → Tentatively NAD . ]

"`scheduler` requires `copyable` which requires assignment."

Date: 2025-10-27.16:17:32
Addresses US 256-383

The specification of change_coroutine_scheduler(sched) uses std::exchange to put the scheduler into place (in [task.promise] paragraph 11). The problem is that std::exchange(x, v) expects x to be assignable from v but there is no requirement for scheduler to be assignable.

History
Date User Action Args
2025-10-27 09:58:11adminsetmessages: + msg15442
2025-10-23 10:49:28adminsetmessages: + msg15376
2025-10-23 10:49:28adminsetstatus: new -> nad
2025-09-01 11:52:04adminsetmessages: + msg14992
2025-08-31 00:00:00admincreate