Title
Missing rvalue reference qualification for task::connect()
Status
wp
Section
[task.class]
Submitter
Dietmar Kühl

Created on 2025-08-31.00:00:00 last changed 5 days ago

Messages

Date: 2025-10-27.09:58:11

Proposed resolution:

In the synopsis in [task.class] add rvalue reference qualification to task::connect():

namespace std::execution {
  template<class T, class Environment>
  class task {
    ...
    template<receiver Rcvr>
        state<Rcvr> connect(Rcvr&& rcvr) &&;
    ...
  }
}

In the specification in [task.members] paragraph 3 add rvalue reference qualification to task::connect():

template<receiver Rcvr>
    state<Rcvr> connect(Rcvr&& rcvr) &&;

-3- Precondition: bool(handle) is true.

-4- Effects: Equivalent to:

    return state<Rcvr>(exchange(handle, {}), std::forward<Rcvr>(recv));

Date: 2025-11-11.10:48:16

[ Kona 2025-11-08; Status changed: Voting → WP. ]

Date: 2025-10-15.00:00:00

[ 2025-10-17; Reflector poll. ]

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

"It's nice to rvalue qualify such a function, but it is not strictly necessary."

Date: 2025-10-27.16:17:32
Addresses US 244-375

Coroutines can't be copied. Thus, a task can be connect() just once. To represent that task::connect() should be rvalue reference qualified but currently it isn't.

History
Date User Action Args
2025-11-11 10:48:16adminsetstatus: voting -> wp
2025-10-30 17:45:31adminsetstatus: ready -> voting
2025-10-27 09:58:11adminsetmessages: + msg15445
2025-10-17 14:12:23adminsetmessages: + msg15220
2025-10-17 14:12:23adminsetstatus: new -> ready
2025-09-01 17:08:00adminsetmessages: + msg14998
2025-08-31 00:00:00admincreate