From f65623dd5a083c9a75126a2124464aa760dd66d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Mon, 1 Sep 2025 00:08:33 +0100 Subject: [PATCH 1/3] =?UTF-8?q?New=20issue=20from=20Dietmar=20K=C3=BChl:?= =?UTF-8?q?=20Missing=20default=20template=20arguments=20for=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xml/issue4343.xml | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 xml/issue4343.xml diff --git a/xml/issue4343.xml b/xml/issue4343.xml new file mode 100644 index 0000000000..37073c0f93 --- /dev/null +++ b/xml/issue4343.xml @@ -0,0 +1,56 @@ + + + + +Missing default template arguments for <code>task</code> +
+Dietmar Kühl +01 Sep 2025 +99 + + +

+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. +

+
+ + +

+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 {
+     ...
+  };
+}
+
+

+
+ +
From 3903305900a993f840711ef24ea0312f1e9cedd1 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 1 Sep 2025 21:17:48 +0100 Subject: [PATCH 2/3] Apply suggestions from code review --- xml/issue4343.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xml/issue4343.xml b/xml/issue4343.xml index 37073c0f93..248999d520 100644 --- a/xml/issue4343.xml +++ b/xml/issue4343.xml @@ -13,13 +13,12 @@ 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]. +synopsis of . 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). +was replaced by the class template env by ).

There could be a counter argument to defining a default for the @@ -40,8 +39,7 @@ on 2025-08-26 the direction is to add the default arguments.

Add default template arguments for task for T = void and Environment = env<> -in the synopsis of [task.class]: +in the synopsis of :

 namespace std::execution {
   template<class T = void, class Environment = env<>>

From 96b9b60be0d5bfae00b8601a6b58b2cdbe8a790f Mon Sep 17 00:00:00 2001
From: Jonathan Wakely 
Date: Mon, 1 Sep 2025 21:20:40 +0100
Subject: [PATCH 3/3] Update xml/issue4343.xml

---
 xml/issue4343.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xml/issue4343.xml b/xml/issue4343.xml
index 248999d520..0260ac7cdb 100644
--- a/xml/issue4343.xml
+++ b/xml/issue4343.xml
@@ -18,7 +18,7 @@ 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 ).
+was replaced by the class template env by ).
 

There could be a counter argument to defining a default for the