Title
Missing default template arguments for task
Status
wp
Section
[task.class]
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 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 {
     ...
  };
}

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 243-376

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:16adminsetstatus: voting -> wp
2025-10-30 17:45:31adminsetstatus: ready -> voting
2025-10-27 09:58:11adminsetmessages: + msg15447
2025-10-17 14:50:10adminsetmessages: + msg15235
2025-10-17 14:50:10adminsetstatus: new -> ready
2025-09-01 20:23:52adminsetmessages: + msg15002
2025-09-01 00:00:00admincreate