forked from cplusplus/LWG
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathissue4334.xml
More file actions
40 lines (36 loc) · 1.55 KB
/
issue4334.xml
File metadata and controls
40 lines (36 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version='1.0' encoding='utf-8' standalone='no'?>
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
<issue num="4334" status="New">
<title><code>taskYour Titlelt;...Your Titlegt;::promise_type</code> supports arbitrary <code>allocator_arg</code> position</title>
<section><sref ref="[task.promise]"/></section>
<submitter>Dietmar Kühl</submitter>
<date>31 Aug 2025</date>
<priority>99</priority>
<discussion>
<p>
Normally the <code>allocator_arg</code> argument has to be the first
argument when present. For <code>task<...>::promise_type</code>
the <code>allocator_arg</code> 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
<code>allocator_arg</code> argument and the allocator should be
limited to come first.
</p>
<p>
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 <code>, auto&&...</code>.
Instead of constraining <code>task</code> it may be more reasonable
to add the flexibility to <code>generator</code>.
</p>
</discussion>
<resolution>
<p>
</p>
</resolution>
</issue>