Title
task::promise_type::await_transform declaration and definition mismatch
Status
ready
Section
[task.promise]
Submitter
Dietmar Kühl

Created on 2026-02-21.00:00:00 last changed 1 week ago

Messages

Date: 2026-02-27.17:32:50

Proposed resolution:

This wording is relative to N5032.

  1. Change the declarations of await_transform in the synopsis of promise_type in [task.promise] to match the definition in [task.promise] p9 except for omitting the noexcept specifier:

    namespace std::execution {
      template<class T, class Environment>
      class task<T, Environment>::promise_type {
      public:
        ... 
        template<class E>
          unspecified yield_value(with_error<E> error);
    
        template<class Asender Sender>
          auto await_transform(A&& aSender&& sndr);
        template<class Sch>
          auto await_transform(change_coroutine_scheduler<Sch> sch);
    
        unspecified get_env() const noexcept;
        ...
      };
    }
    
  2. Remove the noexcept specifier from the declarations of await_transform in the definition of promise_type in [task.promise] p9:

    template<sender Sender>
      auto await_transform(Sender&& sndr) noexcept;
    

    -9- Returns: If same_as<inline_scheduler, scheduler_type> is true returns as_awaitable(std::forward<Sender>(sndr), *this); otherwise returns as_awaitable(affine_on(std::forward<Sender>(sndr), SCHED(*this)), *this).

    template<class Sch>
      auto await_transform(change_coroutine_scheduler<Sch> sch) noexcept;
    
    -10- Effects: Equivalent to:
         return await_transform(just(exchange(SCHED(*this), scheduler_type(sch.scheduler))), *this);
    
Date: 2026-02-15.00:00:00

[ 2026-02-27; Reflector poll. ]

Set status to Tentatively Ready after six votes in favour during reflector poll.

Date: 2026-02-21.00:00:00

The declarations of await_transform mismatch between the synopsis in [task.promise] and the definition in [task.promise] paragraph 9:

    template<class A>
      auto await_transform(A&& a);
    template<class Sch>
      auto await_transform(change_coroutine_scheduler<Sch> sch);
vs.
    template<sender Sender>
      auto await_transform(Sender&& sndr) noexcept;
    template<class Sch>
      auto await_transform(change_coroutine_scheduler<Sch> sch) noexcept;

The declaration should be fixed to match the definition.

History
Date User Action Args
2026-02-27 17:32:50adminsetmessages: + msg15988
2026-02-27 17:32:50adminsetstatus: new -> ready
2026-02-22 08:41:22adminsetmessages: + msg15975
2026-02-21 00:00:00admincreate