From Jason Turner

[exec.queries]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp7le1p9od/{from.md → to.md} +196 -0
tmp/tmp7le1p9od/{from.md → to.md} RENAMED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Queries <a id="exec.queries">[[exec.queries]]</a>
2
+
3
+ ### `forwarding_query` <a id="exec.fwd.env">[[exec.fwd.env]]</a>
4
+
5
+ `forwarding_query` asks a query object whether it should be forwarded
6
+ through queryable adaptors.
7
+
8
+ The name `forwarding_query` denotes a query object. For some query
9
+ object `q` of type `Q`, `forwarding_query(q)` is expression-equivalent
10
+ to:
11
+
12
+ - `MANDATE-NOTHROW(q.query(forwarding_query))` if that expression is
13
+ well-formed. *Mandates:* The expression above has type `bool` and is a
14
+ core constant expression if `q` is a core constant expression.
15
+ - Otherwise, `true` if `derived_from<Q, forwarding_query_t>` is `true`.
16
+ - Otherwise, `false`.
17
+
18
+ ### `get_allocator` <a id="exec.get.allocator">[[exec.get.allocator]]</a>
19
+
20
+ `get_allocator` asks a queryable object for its associated allocator.
21
+
22
+ The name `get_allocator` denotes a query object. For a subexpression
23
+ `env`, `get_allocator(env)` is expression-equivalent to
24
+ `MANDATE-NOTHROW(AS-CONST(env).query(get_allocator))`.
25
+
26
+ *Mandates:* If the expression above is well-formed, its type satisfies
27
+ `simple-allocator` [[allocator.requirements.general]].
28
+
29
+ `forwarding_query(get_allocator)` is a core constant expression and has
30
+ value `true`.
31
+
32
+ ### `get_stop_token` <a id="exec.get.stop.token">[[exec.get.stop.token]]</a>
33
+
34
+ `get_stop_token` asks a queryable object for an associated stop token.
35
+
36
+ The name `get_stop_token` denotes a query object. For a subexpression
37
+ `env`, `get_stop_token(env)` is expression-equivalent to:
38
+
39
+ - `MANDATE-NOTHROW(AS-CONST(env).query(get_stop_token))` if that
40
+ expression is well-formed. *Mandates:* The type of the expression
41
+ above satisfies `stoppable_token`.
42
+ - Otherwise, `never_stop_token{}`.
43
+
44
+ `forwarding_query(get_stop_token)` is a core constant expression and has
45
+ value `true`.
46
+
47
+ ### `execution::get_env` <a id="exec.get.env">[[exec.get.env]]</a>
48
+
49
+ `execution::get_env` is a customization point object. For a
50
+ subexpression `o`, `execution::get_env(o)` is expression-equivalent to:
51
+
52
+ - `MANDATE-NOTHROW(AS-CONST(o).get_env())` if that expression is
53
+ well-formed. *Mandates:* The type of the expression above satisfies
54
+ `queryable` [[exec.queryable]].
55
+ - Otherwise, `env<>{}`.
56
+
57
+ The value of `get_env(o)` shall be valid while `o` is valid.
58
+
59
+ [*Note 1*: When passed a sender object, `get_env` returns the sender’s
60
+ associated attributes. When passed a receiver, `get_env` returns the
61
+ receiver’s associated execution environment. — *end note*]
62
+
63
+ ### `execution::get_domain` <a id="exec.get.domain">[[exec.get.domain]]</a>
64
+
65
+ `get_domain` asks a queryable object for its associated execution domain
66
+ tag.
67
+
68
+ The name `get_domain` denotes a query object. For a subexpression `env`,
69
+ `get_domain(env)` is expression-equivalent to
70
+ `MANDATE-NOTHROW(AS-CONST(env).query(get_domain))`.
71
+
72
+ `forwarding_query(execution::get_domain)` is a core constant expression
73
+ and has value `true`.
74
+
75
+ ### `execution::get_scheduler` <a id="exec.get.scheduler">[[exec.get.scheduler]]</a>
76
+
77
+ `get_scheduler` asks a queryable object for its associated scheduler.
78
+
79
+ The name `get_scheduler` denotes a query object. For a subexpression
80
+ `env`, `get_scheduler(env)` is expression-equivalent to
81
+ `MANDATE-NOTHROW(AS-CONST(env).query(get_scheduler))`.
82
+
83
+ *Mandates:* If the expression above is well-formed, its type satisfies
84
+ `scheduler`.
85
+
86
+ `forwarding_query(execution::get_scheduler)` is a core constant
87
+ expression and has value `true`.
88
+
89
+ ### `execution::get_delegation_scheduler` <a id="exec.get.delegation.scheduler">[[exec.get.delegation.scheduler]]</a>
90
+
91
+ `get_delegation_scheduler` asks a queryable object for a scheduler that
92
+ can be used to delegate work to for the purpose of forward progress
93
+ delegation [[intro.progress]].
94
+
95
+ The name `get_delegation_scheduler` denotes a query object. For a
96
+ subexpression `env`, `get_delegation_scheduler(env)` is
97
+ expression-equivalent to
98
+ `MANDATE-NOTHROW(AS-CONST(env).query(get_delegation_scheduler))`.
99
+
100
+ *Mandates:* If the expression above is well-formed, its type satisfies
101
+ `scheduler`.
102
+
103
+ `forwarding_query(execution::get_delegation_scheduler)` is a core
104
+ constant expression and has value `true`.
105
+
106
+ ### `execution::get_forward_progress_guarantee` <a id="exec.get.fwd.progress">[[exec.get.fwd.progress]]</a>
107
+
108
+ ``` cpp
109
+ namespace std::execution {
110
+ enum class forward_progress_guarantee {
111
+ concurrent,
112
+ parallel,
113
+ weakly_parallel
114
+ };
115
+ }
116
+ ```
117
+
118
+ `get_forward_progress_guarantee` asks a scheduler about the forward
119
+ progress guarantee of execution agents created by that scheduler’s
120
+ associated execution resource [[intro.progress]].
121
+
122
+ The name `get_forward_progress_guarantee` denotes a query object. For a
123
+ subexpression `sch`, let `Sch` be `decltype((sch))`. If `Sch` does not
124
+ satisfy `scheduler`, `get_forward_progress_guarantee` is ill-formed.
125
+ Otherwise, `get_forward_progress_guarantee(sch)` is
126
+ expression-equivalent to:
127
+
128
+ - `MANDATE-NOTHROW(AS-CONST(sch).query(get_forward_progress_guarantee))`,
129
+ if that expression is well-formed. *Mandates:* The type of the
130
+ expression above is `forward_progress_guarantee`.
131
+ - Otherwise, `forward_progress_guarantee::weakly_parallel`.
132
+
133
+ If `get_forward_progress_guarantee(sch)` for some scheduler `sch`
134
+ returns `forward_progress_guarantee::concurrent`, all execution agents
135
+ created by that scheduler’s associated execution resource shall provide
136
+ the concurrent forward progress guarantee. If it returns
137
+ `forward_progress_guarantee::parallel`, all such execution agents shall
138
+ provide at least the parallel forward progress guarantee.
139
+
140
+ ### `execution::get_completion_scheduler` <a id="exec.get.compl.sched">[[exec.get.compl.sched]]</a>
141
+
142
+ `get_completion_scheduler<completion-tag>` obtains the completion
143
+ scheduler associated with a completion tag from a sender’s attributes.
144
+
145
+ The name `get_completion_scheduler` denotes a query object template. For
146
+ a subexpression `q`, the expression
147
+ `get_completion_scheduler<completion-tag>(q)` is ill-formed if
148
+ *`completion-tag`* is not one of `set_value_t`, `set_error_t`, or
149
+ `set_stopped_t`. Otherwise,
150
+ `get_completion_scheduler<completion-tag>(q)` is expression-equivalent
151
+ to
152
+
153
+ ``` cpp
154
+ MANDATE-NOTHROW(AS-CONST(q).query(get_completion_scheduler<completion-tag>))
155
+ ```
156
+
157
+ *Mandates:* If the expression above is well-formed, its type satisfies
158
+ `scheduler`.
159
+
160
+ Let *`completion-fn`* be a completion function [[exec.async.ops]]; let
161
+ *`completion-tag`* be the associated completion tag of
162
+ *`completion-fn`*; let `args` be a pack of subexpressions; and let
163
+ `sndr` be a subexpression such that `sender<decltype((sndr))>` is `true`
164
+ and `get_completion_scheduler<completion-tag>(get_env(sndr))` is
165
+ well-formed and denotes a scheduler `sch`. If an asynchronous operation
166
+ created by connecting `sndr` with a receiver `rcvr` causes the
167
+ evaluation of `completion-fn(rcvr, args...)`, the behavior is undefined
168
+ unless the evaluation happens on an execution agent that belongs to
169
+ `sch`’s associated execution resource.
170
+
171
+ The expression
172
+ `forwarding_query(get_completion_scheduler<completion-tag>)` is a core
173
+ constant expression and has value `true`.
174
+
175
+ ### `execution::get_await_completion_adaptor` <a id="exec.get.await.adapt">[[exec.get.await.adapt]]</a>
176
+
177
+ `get_await_completion_adaptor` asks a queryable object for its
178
+ associated awaitable completion adaptor.
179
+
180
+ The name `get_await_completion_adaptor` denotes a query object. For a
181
+ subexpression `env`,
182
+
183
+ ``` cpp
184
+ get_await_completion_adaptor(env)
185
+ ```
186
+
187
+ is expression-equivalent to
188
+
189
+ ``` cpp
190
+ MANDATE-NOTHROW(AS-CONST(env).query(get_await_completion_adaptor))
191
+ ```
192
+
193
+ `forwarding_query(execution::get_await_completion_adaptor)`
194
+
195
+ is a core constant expression and has value `true`.
196
+