Created on 2026-02-21.00:00:00 last changed 1 week ago
Proposed resolution:
This wording is relative to N5032.
Change the task synopsis in [task.class] to not have a completion_signatures type alias, but instead have a static consteval get_completion_signatures() member function that returns the completion signatures:
namespace std::execution {
template<class T = void, class Environment = env<>>
class task {
// [task.state]
template<receiver Rcvr>
class state; // exposition only
public:
using sender_concept = sender_t;
using completion_signatures = see below;
using allocator_type = see below;
using scheduler_type = see below;
using stop_source_type = see below;
using stop_token_type = decltype(declval<stop_source_type>().get_token());
using error_types = see below;
// [task.promise]
class promise_type;
task(task&&) noexcept;
~task();
template<class Self, class... Env>
static consteval auto get_completion_signatures();
template<receiver Rcvr>
state<Rcvr> connect(Rcvr&& rcvr) &&;
private:
coroutine_handle<promise_type> handle; // exposition only
};
}
Remove [task.class] paragraph 4 (the specification moves to [task.members]):
-4- The type aliascompletion_signaturesis a specialization ofexecution::completion_signatureswith the template arguments (in unspecified order):
-4.1- --set_value_t()ifTisvoid, andset_value_t(T)otherwise;
-4.2- -- template arguments of the specialization ofexecution::completion_signaturesdenoted byerror_types; and
-4.3- --set_stopped_t().
Add a new paragraph to [task.members] before the specification of the connect member function, with the specification of the new get_completion_signatures member function:
template<class Self, class... Env> static consteval auto get_completion_signatures();-?- Let the type
Cbe a specialization ofexecution::completion_signatureswith the template arguments (in unspecified order):-?.1- --
set_value_t()ifTisvoid, andset_value_t(T)otherwise;-?.2- -- template arguments of the specialization of
execution::completion_signaturesdenoted byerror_types; and-?.3- --
set_stopped_t().-?- Returns:
C().
[ 2026-02-27; Reflector poll. ]
Set status to Tentatively Ready after 6 votes in favour during reflector poll.
The changes made by P3164 mean that it isn't sufficient
to have a completion_signatures type alias in the
task class. Instead, it needs to have a
static consteval get_completion_signatures() member
function that returns the completion signatures. Instead of defining
a type alias, the function can return the same type.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-02-27 16:05:19 | admin | set | messages: + msg15983 |
| 2026-02-27 16:05:19 | admin | set | status: new -> ready |
| 2026-02-22 08:36:20 | admin | set | messages: + msg15973 |
| 2026-02-21 00:00:00 | admin | create | |