Title
task::promise_type::return_value default template parameter
Status
wp
Section
[task.promise]
Submitter
Dietmar Kühl

Created on 2025-09-01.00:00:00 last changed 5 days ago

Messages

Date: 2025-10-27.09:58:11

Proposed resolution:

Add a default template argument of T to the template parameter V of task::promise_type::return_value in the synopsis of [task.promise]:

namespace std::execution {
  template<class T, class Environment>
  class task<T, Environment>::promise_type {
     ...
    template<typename V = T>
    void return_value(V&& value);
    ...
  };

}

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.

Date: 2025-10-27.16:17:32
Addresses US 251-388

The template parameter V of task::promise_type::return_value doesn't have a default template argument specified. Specifying a default template argument of T would enable use of co_return { ... } which would be consistent with normal return statements. This feature was not discussed in the design paper but based on the LEWG discussion on 2025-08-26 it is considered to be more a bug fix than a new feature.

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: + msg15449
2025-10-17 14:12:23adminsetmessages: + msg15222
2025-10-17 14:12:23adminsetstatus: new -> ready
2025-09-01 20:31:00adminsetmessages: + msg15012
2025-09-01 00:00:00admincreate