Skip to content

Commit 1600106

Browse files
committed
changes requested during the 2024-05-08 LWG wording review telecon
1 parent ef9a944 commit 1600106

File tree

1 file changed

+67
-85
lines changed

1 file changed

+67
-85
lines changed

execution.bs

Lines changed: 67 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -4976,7 +4976,7 @@ explicit stop_callback(stop_token&& st, <del>C</del><ins>Initializer</ins>&& <de
49764976
static constexpr bool stop_requested() noexcept { return false; }
49774977
static constexpr bool stop_possible() noexcept { return false; }
49784978

4979-
bool operator==(const never_stop_token&) const noexcept = default;
4979+
bool operator==(const never_stop_token&) const = default;
49804980
};
49814981
}
49824982
</pre>
@@ -5003,8 +5003,8 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
50035003
template&lt;class CallbackFn>
50045004
using callback_type = inplace_stop_callback&lt;CallbackFn>;
50055005

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;
50085008

50095009
// [stoptoken.inplace.mem], member functions
50105010
bool stop_requested() const noexcept;
@@ -5061,18 +5061,14 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
50615061

50625062
#### General <b>[stopsource.inplace.general]</b> #### {#spec-stopsource.inplace.general}
50635063

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>.
50695065

50705066
<pre highlight="c++">
50715067
namespace std {
50725068
class inplace_stop_source {
50735069
public:
50745070
// [stopsource.inplace.cons], constructors, copy, and assignment
5075-
inplace_stop_source() noexcept;
5071+
constexpr inplace_stop_source() noexcept;
50765072

50775073
inplace_stop_source(inplace_stop_source&&) = delete;
50785074
inplace_stop_source(const inplace_stop_source&) = delete;
@@ -5081,7 +5077,7 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
50815077
~inplace_stop_source();
50825078

50835079
//[stopsource.inplace.mem], stop handling
5084-
inplace_stop_token get_token() const noexcept;
5080+
constexpr inplace_stop_token get_token() const noexcept;
50855081
static constexpr bool stop_possible() noexcept { return true; }
50865082
bool stop_requested() const noexcept;
50875083
bool request_stop() noexcept;
@@ -5092,7 +5088,7 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
50925088
#### Constructors, copy, and assignment <b>[stopsource.inplace.cons]</b> #### {#spec-stopsource.inplace.cons}
50935089

50945090
<pre highlight="c++">
5095-
inplace_stop_source() noexcept;
5091+
constexpr inplace_stop_source() noexcept;
50965092
</pre>
50975093

50985094
1. *Effects*: Initializes a new stop state inside `*this`.
@@ -5102,10 +5098,11 @@ inplace_stop_source() noexcept;
51025098
#### Members <b>[stopsource.inplace.mem]</b> #### {#spec-stopsource.inplace.mem}
51035099

51045100
<pre highlight="c++">
5105-
inplace_stop_token get_token() const noexcept;
5101+
constexpr inplace_stop_token get_token() const noexcept;
51065102
</pre>
51075103

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`.
51095106

51105107
<pre highlight="c++">
51115108
bool stop_requested() const noexcept;
@@ -5135,52 +5132,43 @@ added above, as a new subclause of Stop tokens <b>[thread.stoptoken]</b>.</span>
51355132

51365133
#### General <b>[stopcallback.inplace.general]</b> #### {#spec-stopcallback.inplace.general}
51375134

5138-
1.
5139-
5140-
<pre highlight="c++">
5141-
namespace std {
5142-
template&lt;class CallbackFn>
5143-
class inplace_stop_callback {
5144-
public:
5145-
using callback_type = CallbackFn;
5135+
<pre highlight="c++">
5136+
namespace std {
5137+
template&lt;class CallbackFn>
5138+
class inplace_stop_callback {
5139+
public:
5140+
using callback_type = CallbackFn;
51465141

5147-
// [stopcallback.inplace.cons], constructors and destructor
5148-
template&lt;class Initializer>
5149-
explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
5150-
noexcept(is_nothrow_constructible_v&lt;CallbackFn, Initializer>);
5151-
~inplace_stop_callback();
5142+
// [stopcallback.inplace.cons], constructors and destructor
5143+
template&lt;class Initializer>
5144+
explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
5145+
noexcept(is_nothrow_constructible_v&lt;CallbackFn, Initializer>);
5146+
~inplace_stop_callback();
51525147

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;
51575152

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+
};
51615156

5162-
template&lt;class CallbackFn>
5163-
inplace_stop_callback(inplace_stop_token, CallbackFn)
5164-
-> inplace_stop_callback&lt;CallbackFn>;
5165-
}
5166-
</pre>
5157+
template&lt;class CallbackFn>
5158+
inplace_stop_callback(inplace_stop_token, CallbackFn)
5159+
-> inplace_stop_callback&lt;CallbackFn>;
5160+
}
5161+
</pre>
51675162

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`.
51715164

51725165
2. *Remarks:* For a type `Initializer`, if
51735166
<code><i>stoppable-callback-for</i>&lt;CallbackFn, inplace_stop_token,
51745167
Initializer></code> is satisfied, then
51755168
<code><i>stoppable-callback-for</i>&lt;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]).
51845172

51855173
#### Constructors and destructor <b>[stopcallback.inplace.cons]</b> #### {#spec-stopcallback.inplace.cons}
51865174

@@ -5231,11 +5219,8 @@ template&lt;class Initializer>
52315219
<tr><td><a href="#spec-execution.execute">[exec.execute]</a></td><td>One-way execution</td><td></td></tr>
52325220
</table>
52335221

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

52405225
<table>
52415226
<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&lt;class Initializer>
52475232
<tr>
52485233
<td>core</td>
52495234
<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>
52515236
</tr>
52525237
<tr>
52535238
<td>completion functions</td>
@@ -5259,9 +5244,9 @@ template&lt;class Initializer>
52595244
<td>allow the specialization of the provided sender algorithms</td>
52605245
<td>
52615246
<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>
52655250
</ul>
52665251
</td>
52675252
</tr>
@@ -5270,17 +5255,15 @@ template&lt;class Initializer>
52705255
<td>allow querying different properties of objects</td>
52715256
<td>
52725257
<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>
52775262
</ul>
52785263
</td>
52795264
</tr>
52805265
</table>
52815266

5282-
-- <i>end note</i>]
5283-
52845267
4. This clause makes use of the following exposition-only entities:
52855268

52865269
1. For a subexpression <code><em>expr</em></code>, let
@@ -5293,27 +5276,27 @@ template&lt;class Initializer>
52935276
2. <pre highlight="c++">
52945277
namespace std {
52955278
template&lt;class T>
5296-
concept <i>movable-value</i> =
5279+
concept <i>movable-value</i> = // exposition only
52975280
move_constructible&lt;decay_t&lt;T>> &&
52985281
constructible_from&lt;decay_t&lt;T>, T> &&
5299-
(!is_array_v&lt;remove_cvref_t&lt;T>>);
5282+
(!is_array_v&lt;remove_reference_t&lt;T>>);
53005283
}
53015284
</pre>
53025285

53035286
3. For function types `F1` and `F2` denoting `R1(Args1...)` and
53045287
`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
53065289
`true`.
53075290

53085291
4. For a subexpression `err`, let `Err` be `decltype((err))` and let
53095292
<code><i>AS-EXCEPT-PTR</i>(err)</code> be:
53105293

53115294
1. `err` if `decay_t<Err>` denotes the type `exception_ptr`.
53125295

5313-
- *Mandates:* `err != exception_ptr()` is `true`
5296+
- *Mandates:* `err != exception_ptr()` is `true`.
53145297

53155298
2. Otherwise, `make_exception_ptr(system_error(err))` if `decay_t<Err>`
5316-
denotes the type `error_code`,
5299+
denotes the type `error_code`.
53175300

53185301
3. Otherwise, `make_exception_ptr(err)`.
53195302

@@ -5326,27 +5309,25 @@ template&lt;class Initializer>
53265309
<dfn export=true lt="query object">query object</dfn>. A <dfn
53275310
export=true>query</dfn> is an invocation of a query object with a queryable
53285311
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>
53325314

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...)`.
53385320

53395321
3. The type of a query expression can not be `void`.
53405322

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.
53445325

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...)`.
53475328

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.
53505331

53515332
### `queryable` concept <b>[exec.queryable.concept]</b> ### {#spec-execution.queryable.concept}
53525333

@@ -9751,7 +9732,8 @@ void finish();
97519732
}
97529733
</pre>
97539734

9754-
3. <b><code><i>call-result-t</i>&lt;as_awaitable_t, Value, Promise&> await_transform(Value&& value)</code></b>
9735+
3. <b><code>template&lt;class Value><br/>
9736+
<i>call-result-t</i>&lt;as_awaitable_t, Value, Promise&> await_transform(Value&& value)</code></b>
97559737

97569738
- <i>Effects:</i> equivalent to:
97579739

0 commit comments

Comments
 (0)