4527. await_transform needs to use as_awaitable

Section: 33.13.6.5 [task.promise] Status: New Submitter: Dietmar Kühl Opened: 2026-02-21 Last modified: 2026-02-22

Priority: Not Prioritized

View other active issues in [task.promise].

View all other issues in [task.promise].

View all issues with New status.

Discussion:

In the await_transform overload for change_coroutine_scheduler the return statement repeats the function name instead of using as_awaitable. The return statement needs to be fixed. The change may be editorial.

Note that P3941 recommends removing change_coroutine_scheduler and the corresponding overload of await_transform entirely.

Proposed resolution:

This wording is relative to N5032.

  1. Change 33.13.6.5 [task.promise] p10 to use as_awaitable in the Effects clause:

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

    -10- Effects: Equivalent to:

    return await_transformas_awaitable(just(exchange(SCHED(*this), scheduler_type(sch.scheduler))), *this);