Created on 2025-09-01.00:00:00 last changed 5 days ago
Proposed resolution:
Add default template arguments for task for
T = void and Environment = env<>
in the synopsis of [task.class]:
namespace std::execution {
template<class T = void, class Environment = env<>>
class task {
...
};
}
[ Kona 2025-11-08; Status changed: Voting → WP. ]
[ 2025-10-17; Reflector poll. ]
Set status to Tentatively Ready after five votes in favour during reflector poll.
The design discussion of task describes defaults for
the two template parameters T and Environment
of task but these defaults are not reflected in the
synopsis of [task.class].
This is an oversight and should be fixed. The default for
T should be void and the default for
Environment should be env<> (the
design paper used empty_env but this struct
was replaced by the class template env by p3325r5).
There could be a counter argument to defining a default for the
Environment template parameter: this type is used to
determine various customizations of task, e.g., the
allocator_type, the scheduler_type, and
the stop_source_type. Leaving the type a required
argument means that a future standard could choose a possibly better
default than the types determined when the Environment
doesn't define them. On the other hand, a future standard could
provide a suitable alias with modified types under a different
name and/or a different namespace. Based on the LEWG discussion
on 2025-08-26 the direction is to add the default arguments.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-11-11 10:48:16 | admin | set | status: voting -> wp |
| 2025-10-30 17:45:31 | admin | set | status: ready -> voting |
| 2025-10-27 09:58:11 | admin | set | messages: + msg15447 |
| 2025-10-17 14:50:10 | admin | set | messages: + msg15235 |
| 2025-10-17 14:50:10 | admin | set | status: new -> ready |
| 2025-09-01 20:23:52 | admin | set | messages: + msg15002 |
| 2025-09-01 00:00:00 | admin | create | |