@@ -4976,7 +4976,7 @@ explicit stop_callback(stop_token&& st, <del>C</del><ins>Initializer</ins>&& <de
4976
4976
static constexpr bool stop_requested() noexcept { return false; }
4977
4977
static constexpr bool stop_possible() noexcept { return false; }
4978
4978
4979
- bool operator==(const never_stop_token&) const noexcept = default;
4979
+ bool operator==(const never_stop_token&) const = default;
4980
4980
};
4981
4981
}
4982
4982
</pre>
@@ -5003,8 +5003,8 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
5003
5003
template<class CallbackFn>
5004
5004
using callback_type = inplace_stop_callback<CallbackFn>;
5005
5005
5006
- inplace_stop_token() noexcept = default;
5007
- bool operator==(const inplace_stop_token&) const noexcept = default;
5006
+ inplace_stop_token() = default;
5007
+ bool operator==(const inplace_stop_token&) const = default;
5008
5008
5009
5009
// [stoptoken.inplace.mem] , member functions
5010
5010
bool stop_requested() const noexcept;
@@ -5061,18 +5061,14 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
5061
5061
5062
5062
#### General <b> [stopsource.inplace.general] </b> #### {#spec-stopsource.inplace.general}
5063
5063
5064
- 1. The class `inplace_stop_source` models <i> `stoppable-source`</i> . Unlike
5065
- `stop_source`, `inplace_stop_source` does not require dynamic allocation or
5066
- reference counting of a shared stop state. Instead, it requires that all
5067
- uses of associated `inplace_stop_token` and `inplace_stop_callback`
5068
- objects happen before the `inplace_stop_source` is destroyed.
5064
+ 1. The class `inplace_stop_source` models <i> `stoppable-source`</i> .
5069
5065
5070
5066
<pre highlight="c++">
5071
5067
namespace std {
5072
5068
class inplace_stop_source {
5073
5069
public:
5074
5070
// [stopsource.inplace.cons] , constructors, copy, and assignment
5075
- inplace_stop_source() noexcept;
5071
+ constexpr inplace_stop_source() noexcept;
5076
5072
5077
5073
inplace_stop_source(inplace_stop_source&&) = delete;
5078
5074
inplace_stop_source(const inplace_stop_source&) = delete;
@@ -5081,7 +5077,7 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
5081
5077
~inplace_stop_source();
5082
5078
5083
5079
//[stopsource.inplace.mem] , stop handling
5084
- inplace_stop_token get_token() const noexcept;
5080
+ constexpr inplace_stop_token get_token() const noexcept;
5085
5081
static constexpr bool stop_possible() noexcept { return true; }
5086
5082
bool stop_requested() const noexcept;
5087
5083
bool request_stop() noexcept;
@@ -5092,7 +5088,7 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
5092
5088
#### Constructors, copy, and assignment <b> [stopsource.inplace.cons] </b> #### {#spec-stopsource.inplace.cons}
5093
5089
5094
5090
<pre highlight="c++">
5095
- inplace_stop_source() noexcept;
5091
+ constexpr inplace_stop_source() noexcept;
5096
5092
</pre>
5097
5093
5098
5094
1. *Effects*: Initializes a new stop state inside `*this`.
@@ -5102,10 +5098,11 @@ inplace_stop_source() noexcept;
5102
5098
#### Members <b> [stopsource.inplace.mem] </b> #### {#spec-stopsource.inplace.mem}
5103
5099
5104
5100
<pre highlight="c++">
5105
- inplace_stop_token get_token() const noexcept;
5101
+ constexpr inplace_stop_token get_token() const noexcept;
5106
5102
</pre>
5107
5103
5108
- 1. *Returns*: A new associated `inplace_stop_token` object.
5104
+ 1. *Returns*: A new associated `inplace_stop_token` object. The `inplace_stop_token`
5105
+ object's <i> `stop-source`</i> member is equal to `this`.
5109
5106
5110
5107
<pre highlight="c++">
5111
5108
bool stop_requested() const noexcept;
@@ -5135,52 +5132,43 @@ added above, as a new subclause of Stop tokens <b>[thread.stoptoken]</b>.</span>
5135
5132
5136
5133
#### General <b> [stopcallback.inplace.general] </b> #### {#spec-stopcallback.inplace.general}
5137
5134
5138
- 1.
5139
-
5140
- <pre highlight="c++">
5141
- namespace std {
5142
- template<class CallbackFn>
5143
- class inplace_stop_callback {
5144
- public:
5145
- using callback_type = CallbackFn;
5135
+ <pre highlight="c++">
5136
+ namespace std {
5137
+ template<class CallbackFn>
5138
+ class inplace_stop_callback {
5139
+ public:
5140
+ using callback_type = CallbackFn;
5146
5141
5147
- // [stopcallback.inplace.cons] , constructors and destructor
5148
- template<class Initializer>
5149
- explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
5150
- noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
5151
- ~inplace_stop_callback();
5142
+ // [stopcallback.inplace.cons] , constructors and destructor
5143
+ template<class Initializer>
5144
+ explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
5145
+ noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
5146
+ ~inplace_stop_callback();
5152
5147
5153
- inplace_stop_callback(inplace_stop_callback&&) = delete;
5154
- inplace_stop_callback(const inplace_stop_callback&) = delete;
5155
- inplace_stop_callback& operator=(inplace_stop_callback&&) = delete;
5156
- inplace_stop_callback& operator=(const inplace_stop_callback&) = delete;
5148
+ inplace_stop_callback(inplace_stop_callback&&) = delete;
5149
+ inplace_stop_callback(const inplace_stop_callback&) = delete;
5150
+ inplace_stop_callback& operator=(inplace_stop_callback&&) = delete;
5151
+ inplace_stop_callback& operator=(const inplace_stop_callback&) = delete;
5157
5152
5158
- private:
5159
- CallbackFn <i> callback-fn</i> ; <i> // exposition only</i>
5160
- };
5153
+ private:
5154
+ CallbackFn <i> callback-fn</i> ; <i> // exposition only</i>
5155
+ };
5161
5156
5162
- template<class CallbackFn>
5163
- inplace_stop_callback(inplace_stop_token, CallbackFn)
5164
- -> inplace_stop_callback<CallbackFn>;
5165
- }
5166
- </pre>
5157
+ template<class CallbackFn>
5158
+ inplace_stop_callback(inplace_stop_token, CallbackFn)
5159
+ -> inplace_stop_callback<CallbackFn>;
5160
+ }
5161
+ </pre>
5167
5162
5168
- 1. *Mandates*: `inplace_stop_callback` is instantiated with an argument for the
5169
- template parameter `CallbackFn` that satisfies both `invocable` and
5170
- `destructible`.
5163
+ 1. *Mandates*: `CallbackFn` satisfies both `invocable` and `destructible`.
5171
5164
5172
5165
2. *Remarks:* For a type `Initializer`, if
5173
5166
<code><i> stoppable-callback-for</i> <CallbackFn, inplace_stop_token,
5174
5167
Initializer></code> is satisfied, then
5175
5168
<code><i> stoppable-callback-for</i> <CallbackFn, inplace_stop_token,
5176
- Initializer></code> is modeled. The exposition-only <i> `callback-fn`</i>
5177
- member is the associated callback function ([stoptoken.concepts] ) of
5178
- `inplace_stop_callback<CallbackFn>` objects.
5179
-
5180
- Implementations are not permitted to use additional storage, such as dynamic
5181
- memory, to store the state necessary for an `inplace_stop_callback`'s
5182
- association with an `inplace_stop_source` object or to register the callback
5183
- invocation with the associated `inplace_stop_source` object.
5169
+ Initializer></code> is modeled. For an `inplace_stop_callback<CallbackFn>`
5170
+ object, the exposition-only <i> `callback-fn`</i> member is its associated
5171
+ callback function ([stoptoken.concepts] ).
5184
5172
5185
5173
#### Constructors and destructor <b> [stopcallback.inplace.cons] </b> #### {#spec-stopcallback.inplace.cons}
5186
5174
@@ -5231,11 +5219,8 @@ template<class Initializer>
5231
5219
<tr><td> <a href="#spec-execution.execute">[exec.execute]</a> </td><td> One-way execution</td><td></td></tr>
5232
5220
</table>
5233
5221
5234
- 3. [<i> Note:</i> A large number of execution control primitives are
5235
- customization point objects. For an object one might define multiple types of
5236
- customization point objects, for which different rules apply. Table 2 shows
5237
- the types of customization point objects used in the execution control
5238
- library:
5222
+ 3. Table 2 shows the types of customization point objects
5223
+ [customization.point.object] used in the execution control library:
5239
5224
5240
5225
<table>
5241
5226
<caption> Table <i> N+1</i> : Types of customization point objects in the execution control library <b> [tab:execution.cpos] </b></caption>
@@ -5247,7 +5232,7 @@ template<class Initializer>
5247
5232
<tr>
5248
5233
<td> core</td>
5249
5234
<td> provide core execution functionality, and connection between core components</td>
5250
- <td> `connect`, `start`, `execute`</td>
5235
+ <td> e.g., `connect`, `start`, `execute`</td>
5251
5236
</tr>
5252
5237
<tr>
5253
5238
<td> completion functions</td>
@@ -5259,9 +5244,9 @@ template<class Initializer>
5259
5244
<td> allow the specialization of the provided sender algorithms</td>
5260
5245
<td>
5261
5246
<ul>
5262
- <li> sender factories (`schedule`, `just`, `read`, ... )</li>
5263
- <li> sender adaptors (`transfer`, `then`, `let_value`, ... )</li>
5264
- <li> sender consumers (`start_detached`, `sync_wait`)</li>
5247
+ <li> sender factories (e.g., `schedule`, `just`, `read`)</li>
5248
+ <li> sender adaptors (e.g., `transfer`, `then`, `let_value`)</li>
5249
+ <li> sender consumers (e.g., `start_detached`, `sync_wait`)</li>
5265
5250
</ul>
5266
5251
</td>
5267
5252
</tr>
@@ -5270,17 +5255,15 @@ template<class Initializer>
5270
5255
<td> allow querying different properties of objects</td>
5271
5256
<td>
5272
5257
<ul>
5273
- <li> general queries (`get_allocator`, `get_stop_token`, ... )</li>
5274
- <li> environment queries (`get_scheduler`, `get_delegatee_scheduler`, ... )</li>
5275
- <li> scheduler queries (`get_forward_progress_guarantee`, `execute_may_block_caller`, ... )</li>
5276
- <li> sender attribute queries (`get_completion_scheduler`)</li>
5258
+ <li> general queries (e.g., `get_allocator`, `get_stop_token`)</li>
5259
+ <li> environment queries (e.g., `get_scheduler`, `get_delegatee_scheduler`)</li>
5260
+ <li> scheduler queries (e.g., `get_forward_progress_guarantee`, `execute_may_block_caller`)</li>
5261
+ <li> sender attribute queries (e.g., `get_completion_scheduler`)</li>
5277
5262
</ul>
5278
5263
</td>
5279
5264
</tr>
5280
5265
</table>
5281
5266
5282
- -- <i> end note</i> ]
5283
-
5284
5267
4. This clause makes use of the following exposition-only entities:
5285
5268
5286
5269
1. For a subexpression <code><em> expr</em></code> , let
@@ -5293,27 +5276,27 @@ template<class Initializer>
5293
5276
2. <pre highlight="c++">
5294
5277
namespace std {
5295
5278
template<class T>
5296
- concept <i> movable-value</i> =
5279
+ concept <i> movable-value</i> = // exposition only
5297
5280
move_constructible<decay_t<T>> &&
5298
5281
constructible_from<decay_t<T>, T> &&
5299
- (!is_array_v<remove_cvref_t <T>>);
5282
+ (!is_array_v<remove_reference_t <T>>);
5300
5283
}
5301
5284
</pre>
5302
5285
5303
5286
3. For function types `F1` and `F2` denoting `R1(Args1...)` and
5304
5287
`R2(Args2...)` respectively, <code><i> MATCHING-SIG</i> (F1, F2)</code> is
5305
- `true` if and only if `same_as<R1(Args &&...), R2(Args2&&...)>` is
5288
+ `true` if and only if `same_as<R1(Args1 &&...), R2(Args2&&...)>` is
5306
5289
`true`.
5307
5290
5308
5291
4. For a subexpression `err`, let `Err` be `decltype((err))` and let
5309
5292
<code><i> AS-EXCEPT-PTR</i> (err)</code> be:
5310
5293
5311
5294
1. `err` if `decay_t<Err>` denotes the type `exception_ptr`.
5312
5295
5313
- - *Mandates:* `err != exception_ptr()` is `true`
5296
+ - *Mandates:* `err != exception_ptr()` is `true`.
5314
5297
5315
5298
2. Otherwise, `make_exception_ptr(system_error(err))` if `decay_t<Err>`
5316
- denotes the type `error_code`,
5299
+ denotes the type `error_code`.
5317
5300
5318
5301
3. Otherwise, `make_exception_ptr(err)`.
5319
5302
@@ -5326,27 +5309,25 @@ template<class Initializer>
5326
5309
<dfn export=true lt="query object">query object</dfn> . A <dfn
5327
5310
export=true> query</dfn> is an invocation of a query object with a queryable
5328
5311
object as its first argument and a (possibly empty) set of additional
5329
- arguments. The result of a query expression is valid as long as the
5330
- queryable object is valid. <span class="wg21note"> A query imposes syntactic
5331
- and semantic requirements on its invocations.</span>
5312
+ arguments. <span class="wg21note"> A query imposes syntactic and semantic
5313
+ requirements on its invocations.</span>
5332
5314
5333
- 2. Given a subexpression `env` that refers to a queryable object `o`, a query
5334
- object <i> `q` </i> , and a (possibly empty) pack of subexpressions
5335
- `args`, the expression <code><i> q </i> (env, args...) </code> is equal to
5336
- ( [concepts.equality] ) the expression <code><i> q </i> (c , args...)</code> where
5337
- `c` is a `const` lvalue reference to `o `.
5315
+ 2. Let `q` be a query object, let `args` be a (possibly empty) pack of
5316
+ subexpressions, let `env` be a subexpression that refers to a queryable
5317
+ object `o` of type `O`, and let `cenv` be a subexpression refering to `o`
5318
+ such that `decltype((cenv))` is `const O&`. The expression `q(env , args...)`
5319
+ is equal to ( [concepts.equality] ) the expression `q(cenv, args...) `.
5338
5320
5339
5321
3. The type of a query expression can not be `void`.
5340
5322
5341
- 4. The expression <code><i> q</i> (env, args...)</code> is equality-preserving
5342
- ([concepts.equality] ) and does not modify the function object or the
5343
- arguments.
5323
+ 4. The expression `q(env, args...)` is equality-preserving
5324
+ ([concepts.equality] ) and does not modify the query object or the arguments.
5344
5325
5345
- 5. If the expression <code> env.query(<i> q </i> , args...)</code> is well-formed,
5346
- then it is expression-equivalent to <code><i> q </i> (env, args...)</code> .
5326
+ 5. If the expression ` env.query(q , args...)` is well-formed, then it is
5327
+ expression-equivalent to `q (env, args...)` .
5347
5328
5348
- 6. Unless otherwise specified, the value returned by the expression
5349
- <code><i> q </i> (env, args...) </code> is valid as long as `env` is valid.
5329
+ 6. Unless otherwise specified, the result of a query is valid as long as the
5330
+ queryable object is valid.
5350
5331
5351
5332
### `queryable` concept <b> [exec.queryable.concept] </b> ### {#spec-execution.queryable.concept}
5352
5333
@@ -9751,7 +9732,8 @@ void finish();
9751
9732
}
9752
9733
</pre>
9753
9734
9754
- 3. <b><code><i> call-result-t</i> <as_awaitable_t, Value, Promise&> await_transform(Value&& value)</code></b>
9735
+ 3. <b><code> template<class Value><br/>
9736
+ <i> call-result-t</i> <as_awaitable_t, Value, Promise&> await_transform(Value&& value)</code></b>
9755
9737
9756
9738
- <i> Effects:</i> equivalent to:
9757
9739
0 commit comments