diff --git a/xml/issue4334.xml b/xml/issue4334.xml new file mode 100644 index 0000000000..45747a13f0 --- /dev/null +++ b/xml/issue4334.xml @@ -0,0 +1,40 @@ + + + + +<code>task<...>::promise_type</code> supports arbitrary <code>allocator_arg</code> position +
+Dietmar Kühl +31 Aug 2025 +99 + + +

+Normally the allocator_arg argument has to be the first +argument when present. For task<...>::promise_type +the allocator_arg can appear at an arbitrary position +(except the last because it always needs to be followed by the +allocator). This permission is inconsistent and the position of the +allocator_arg argument and the allocator should be +limited to come first. +

+

+For containers the optional support for allocators is implemented +once for every container. For coroutines the optional support for +allocators is implemented once for every coroutine definition. To +support an optional allocator the coroutine definition needs to use +an allocator and either gets duplicated not using an allocator or +a forwarding function is added which adds the default allocator. +With the flexible allocator position optional allocator support can be provided +using a trailing argument list, i.e., adding , auto&&.... +Instead of constraining task it may be more reasonable +to add the flexibility to generator. +

+
+ + +

+

+
+ +