diff --git a/xml/issue4343.xml b/xml/issue4343.xml new file mode 100644 index 0000000000..0260ac7cdb --- /dev/null +++ b/xml/issue4343.xml @@ -0,0 +1,54 @@ + + + + +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 . +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 ). +

+

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

+namespace std::execution {
+  template<class T = void, class Environment = env<>>
+  class task {
+     ...
+  };
+}
+
+

+
+ +