@@ -1503,20 +1503,37 @@ The changes since R8 are as follows:
1503
1503
1504
1504
<b> Fixes:</b>
1505
1505
1506
- * The `tag_invoke` mechanism has been replace with member functions
1506
+ * The `tag_invoke` mechanism has been replaced with member functions
1507
1507
for customizations as per \[P2855] (https://wg21.link/p2855).
1508
1508
1509
1509
* Per guidance from LWG and LEWG, `receiver_adaptor` has been removed.
1510
1510
1511
- * The `receiver` concept is tweaked to requires that receiver types are not
1511
+ * The `receiver` concept is tweaked to require that receiver types are not
1512
1512
`final`. Without `receiver_adaptor` and `tag_invoke`, receiver adaptors
1513
1513
are easily written using implementation inheritance.
1514
1514
1515
+ * `std::tag_t` is made exposition-only.
1516
+
1517
+ * The types `in_place_stop_token`, `in_place_stop_source`, and
1518
+ `in_place_stop_callback` are renamed to `inplace_stop_token`,
1519
+ `inplace_stop_source`, and `inplace_stop_callback`, respectively.
1520
+
1515
1521
<b> Enhancements:</b>
1516
1522
1517
1523
* The specification of the `sync_wait` algorithm has been updated
1518
1524
for clarity.
1519
1525
1526
+ * The specification of all the stop token, source, and callback types have
1527
+ been re-expressed in terms of shared concepts.
1528
+
1529
+ * Declarations are shown in their proper namespaces.
1530
+
1531
+ * Editorial changes have been made to clarify what text is added,
1532
+ what is removed, and what is an editorial note.
1533
+
1534
+ * The section numbers of the proposed wording now match the section
1535
+ numbers in the working draft of the C++ standard.
1536
+
1520
1537
## R8 ## {#r8}
1521
1538
1522
1539
The changes since R7 are as follows:
@@ -2407,8 +2424,8 @@ cancellation include:
2407
2424
different implementation strategies.
2408
2425
* Add `std::unstoppable_token` concept for detecting whether a `stoppable_token`
2409
2426
can never receive a stop-request.
2410
- * Add `std::in_place_stop_token `, `std::in_place_stop_source ` and
2411
- `std::in_place_stop_callback <CB>` types that provide a more efficient
2427
+ * Add `std::inplace_stop_token `, `std::inplace_stop_source ` and
2428
+ `std::inplace_stop_callback <CB>` types that provide a more efficient
2412
2429
implementation of a stop-token for use in structured concurrency situations.
2413
2430
* Add `std::never_stop_token` for use in places where you never want to issue a
2414
2431
stop-request.
@@ -3968,9 +3985,9 @@ a new bullet as follows:</span>
3968
3985
3969
3986
<div class="block-insert">
3970
3987
* when a callback invocation exits via an exception when requesting stop on a
3971
- `std::stop_source` or a `std::in_place_stop_source ` ([stopsource.mem] ,
3988
+ `std::stop_source` or a `std::inplace_stop_source ` ([stopsource.mem] ,
3972
3989
[stopsource.inplace.mem] ), or in the constructor of `std::stop_callback` or
3973
- `std::in_place_stop_callback ` ([stopcallback.cons] ,
3990
+ `std::inplace_stop_callback ` ([stopcallback.cons] ,
3974
3991
[stopcallback.inplace.cons] ) when a callback invocation exits via an
3975
3992
exception.
3976
3993
@@ -4162,8 +4179,8 @@ the new `stoppable_source` concept.</span>
4162
4179
The last remaining owner of the stop state automatically releases the
4163
4180
resources associated with the stop state.
4164
4181
4165
- 6. The types `in_place_stop_source ` and `in_place_stop_token ` and the class
4166
- template `in_place_stop_callback ` do no dynamic memory allocation or reference
4182
+ 6. The types `inplace_stop_source ` and `inplace_stop_token ` and the class
4183
+ template `inplace_stop_callback ` do no dynamic memory allocation or reference
4167
4184
counting of the stop state. They are for use when the lifetimes of the tokens
4168
4185
and the callbacks are known to nest within the lifetime of the source.
4169
4186
@@ -4207,15 +4224,15 @@ namespace std {
4207
4224
<div class="block-insert"> <i> // [stoptoken.never] , class never_stop_token</i>
4208
4225
class never_stop_token;
4209
4226
4210
- <i> // [stoptoken.inplace] , class in_place_stop_token </i>
4211
- class in_place_stop_token ;
4227
+ <i> // [stoptoken.inplace] , class inplace_stop_token </i>
4228
+ class inplace_stop_token ;
4212
4229
4213
- <i> // [stopsource.inplace] , class in_place_stop_source </i>
4214
- class in_place_stop_source ;
4230
+ <i> // [stopsource.inplace] , class inplace_stop_source </i>
4231
+ class inplace_stop_source ;
4215
4232
4216
- <i> // [stopcallback.inplace] , class template in_place_stop_callback </i>
4233
+ <i> // [stopcallback.inplace] , class template inplace_stop_callback </i>
4217
4234
template<class Callback>
4218
- class in_place_stop_callback ;
4235
+ class inplace_stop_callback ;
4219
4236
4220
4237
template<class T, class Callback>
4221
4238
using stop_callback_for_t = T::template callback_type<Callback>;</div>
@@ -4961,44 +4978,44 @@ explicit stop_callback(stop_token&& st, C&& cb)
4961
4978
</div>
4962
4979
</div>
4963
4980
4964
- <span class="ed-note"> Insert a new subclause, Class `in_place_stop_token `
4981
+ <span class="ed-note"> Insert a new subclause, Class `inplace_stop_token `
4965
4982
<b> [stoptoken.inplace] </b> , after the subclause added above, as a new subclause
4966
4983
of Stop tokens <b> [thread.stoptoken] </b> .</span>
4967
4984
<div class="standardeze">
4968
4985
<div class="block-insert">
4969
- ### Class `in_place_stop_token ` <b> [stoptoken.inplace] </b> ### {#spec-stoptoken.inplace}
4986
+ ### Class `inplace_stop_token ` <b> [stoptoken.inplace] </b> ### {#spec-stoptoken.inplace}
4970
4987
4971
4988
#### General <b> [stoptoken.inplace.general] </b> #### {#spec-stoptoken.inplace.general}
4972
4989
4973
- 1. The class `in_place_stop_token ` models the concept `stoppable_token`. It
4974
- references the stop state of its associated `in_place_stop_source ` object
4990
+ 1. The class `inplace_stop_token ` models the concept `stoppable_token`. It
4991
+ references the stop state of its associated `inplace_stop_source ` object
4975
4992
([stopsource.inplace] ), if any.
4976
4993
4977
4994
<pre highlight="c++">
4978
4995
namespace std {
4979
- class in_place_stop_token {
4996
+ class inplace_stop_token {
4980
4997
public:
4981
4998
template<class CB>
4982
- using callback_type = in_place_stop_callback <CB>;
4999
+ using callback_type = inplace_stop_callback <CB>;
4983
5000
4984
- in_place_stop_token () noexcept = default;
4985
- bool operator==(const in_place_stop_token &) const noexcept = default;
5001
+ inplace_stop_token () noexcept = default;
5002
+ bool operator==(const inplace_stop_token &) const noexcept = default;
4986
5003
4987
5004
// [stoptoken.inplace.mem] , member functions
4988
5005
bool stop_requested() const noexcept;
4989
5006
bool stop_possible() const noexcept;
4990
- void swap(in_place_stop_token &) noexcept;
5007
+ void swap(inplace_stop_token &) noexcept;
4991
5008
4992
5009
private:
4993
- const in_place_stop_source * <i> stop-source</i> = nullptr; <i> // exposition only</i>
5010
+ const inplace_stop_source * <i> stop-source</i> = nullptr; <i> // exposition only</i>
4994
5011
};
4995
5012
}
4996
5013
</pre>
4997
5014
4998
5015
#### Member functions <b> [stoptoken.inplace.members] </b> #### {#spec-stoptoken.inplace.members}
4999
5016
5000
5017
<pre highlight="c++">
5001
- void swap(in_place_stop_token & rhs) noexcept;
5018
+ void swap(inplace_stop_token & rhs) noexcept;
5002
5019
</pre>
5003
5020
5004
5021
1. *Effects*: Exchanges the values of <i> `stop-source`</i> and
@@ -5013,7 +5030,7 @@ bool stop_requested() const noexcept;
5013
5030
5014
5031
2. <span class="wg21note"> As specified in [basic.life] , the behavior of
5015
5032
`stop_requested()` is undefined unless the call strongly happens before the
5016
- start of the destructor of the associated `in_place_stop_source `, if
5033
+ start of the destructor of the associated `inplace_stop_source `, if
5017
5034
any.</span>
5018
5035
5019
5036
<pre highlight="c++">
@@ -5025,41 +5042,41 @@ bool stop_possible() const noexcept;
5025
5042
4. <span class="wg21note"> As specified in [basic.stc.general] , the behavior of
5026
5043
`stop_possible()` is implementation-defined unless the call strongly happens
5027
5044
before the end of the storage duration of the associated
5028
- `in_place_stop_source ` object, if any.</span>
5045
+ `inplace_stop_source ` object, if any.</span>
5029
5046
5030
5047
</div>
5031
5048
</div>
5032
5049
5033
- <span class="ed-note"> Insert a new subclause, Class `in_place_stop_source `
5050
+ <span class="ed-note"> Insert a new subclause, Class `inplace_stop_source `
5034
5051
<b> [stopsource.inplace] </b> , after the subclause added above, as a new subclause
5035
5052
of Stop tokens <b> [thread.stoptoken] </b> .</span>
5036
5053
<div class="standardeze">
5037
5054
<div class="block-insert">
5038
- ### Class `in_place_stop_source ` <b> [stopsource.inplace] </b> ### {#spec-stopsource.inplace}
5055
+ ### Class `inplace_stop_source ` <b> [stopsource.inplace] </b> ### {#spec-stopsource.inplace}
5039
5056
5040
5057
#### General <b> [stopsource.inplace.general] </b> #### {#spec-stopsource.inplace.general}
5041
5058
5042
- 1. The class `in_place_stop_source ` models `stoppable_source`. Unlike
5043
- `stop_source`, `in_place_stop_source ` does not require dynamic allocation or
5059
+ 1. The class `inplace_stop_source ` models `stoppable_source`. Unlike
5060
+ `stop_source`, `inplace_stop_source ` does not require dynamic allocation or
5044
5061
reference counting of a shared stop state. Instead, it requires that all
5045
- uses of associated `in_place_stop_token ` and `in_place_stop_callback `
5046
- objects happen before the `in_place_stop_source ` is destroyed.
5062
+ uses of associated `inplace_stop_token ` and `inplace_stop_callback `
5063
+ objects happen before the `inplace_stop_source ` is destroyed.
5047
5064
5048
5065
<pre highlight="c++">
5049
5066
namespace std {
5050
- class in_place_stop_source {
5067
+ class inplace_stop_source {
5051
5068
public:
5052
5069
// [stopsource.inplace.cons] , constructors, copy, and assignment
5053
- in_place_stop_source () noexcept;
5070
+ inplace_stop_source () noexcept;
5054
5071
5055
- in_place_stop_source(in_place_stop_source &&) = delete;
5056
- in_place_stop_source (const in_place_stop_source &) = delete;
5057
- in_place_stop_source & operator=(in_place_stop_source &&) = delete;
5058
- in_place_stop_source & operator=(const in_place_stop_source &) = delete;
5059
- ~in_place_stop_source ();
5072
+ inplace_stop_source(inplace_stop_source &&) = delete;
5073
+ inplace_stop_source (const inplace_stop_source &) = delete;
5074
+ inplace_stop_source & operator=(inplace_stop_source &&) = delete;
5075
+ inplace_stop_source & operator=(const inplace_stop_source &) = delete;
5076
+ ~inplace_stop_source ();
5060
5077
5061
5078
//[stopsource.inplace.mem] , stop handling
5062
- in_place_stop_token get_token() const noexcept;
5079
+ inplace_stop_token get_token() const noexcept;
5063
5080
static constexpr bool stop_possible() noexcept { return true; }
5064
5081
bool stop_requested() const noexcept;
5065
5082
bool request_stop() noexcept;
@@ -5070,7 +5087,7 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
5070
5087
#### Constructors, copy, and assignment <b> [stopsource.inplace.cons] </b> #### {#spec-stopsource.inplace.cons}
5071
5088
5072
5089
<pre highlight="c++">
5073
- in_place_stop_source () noexcept;
5090
+ inplace_stop_source () noexcept;
5074
5091
</pre>
5075
5092
5076
5093
1. *Effects*: Initializes a new stop state inside `*this`.
@@ -5080,10 +5097,10 @@ in_place_stop_source() noexcept;
5080
5097
#### Members <b> [stopsource.inplace.mem] </b> #### {#spec-stopsource.inplace.mem}
5081
5098
5082
5099
<pre highlight="c++">
5083
- in_place_stop_token get_token() const noexcept;
5100
+ inplace_stop_token get_token() const noexcept;
5084
5101
</pre>
5085
5102
5086
- 1. *Returns*: A new associated `in_place_stop_token ` object.
5103
+ 1. *Returns*: A new associated `inplace_stop_token ` object.
5087
5104
5088
5105
<pre highlight="c++">
5089
5106
bool stop_requested() const noexcept;
@@ -5104,12 +5121,12 @@ bool request_stop() noexcept;
5104
5121
</div>
5105
5122
5106
5123
<span class="ed-note"> Insert a new subclause, Class template
5107
- `in_place_stop_callback ` <b> [stopcallback.inplace] </b> , after the subclause
5124
+ `inplace_stop_callback ` <b> [stopcallback.inplace] </b> , after the subclause
5108
5125
added above, as a new subclause of Stop tokens <b> [thread.stoptoken] </b> .</span>
5109
5126
<div class="standardeze">
5110
5127
<div class="block-insert">
5111
5128
5112
- ### Class template `in_place_stop_callback ` <b> [stopcallback.inplace] </b> ### {#spec-stopcallback.inplace}
5129
+ ### Class template `inplace_stop_callback ` <b> [stopcallback.inplace] </b> ### {#spec-stopcallback.inplace}
5113
5130
5114
5131
#### General <b> [stopcallback.inplace.general] </b> #### {#spec-stopcallback.inplace.general}
5115
5132
@@ -5118,52 +5135,52 @@ added above, as a new subclause of Stop tokens <b>[thread.stoptoken]</b>.</span>
5118
5135
<pre highlight="c++">
5119
5136
namespace std {
5120
5137
template<class Callback>
5121
- class in_place_stop_callback {
5138
+ class inplace_stop_callback {
5122
5139
public:
5123
5140
using callback_type = Callback;
5124
5141
5125
5142
// [stopcallback.inplace.cons] , constructors and destructor
5126
5143
template<class C>
5127
- explicit in_place_stop_callback(in_place_stop_token st, C&& cb)
5144
+ explicit inplace_stop_callback(inplace_stop_token st, C&& cb)
5128
5145
noexcept(is_nothrow_constructible_v<Callback, C>);
5129
- ~in_place_stop_callback ();
5146
+ ~inplace_stop_callback ();
5130
5147
5131
- in_place_stop_callback(in_place_stop_callback &&) = delete;
5132
- in_place_stop_callback (const in_place_stop_callback &) = delete;
5133
- in_place_stop_callback & operator=(in_place_stop_callback &&) = delete;
5134
- in_place_stop_callback & operator=(const in_place_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;
5135
5152
5136
5153
private:
5137
5154
Callback <i> stop-callback</i> ; <i> // exposition only</i>
5138
5155
};
5139
5156
5140
5157
template<class Callback>
5141
- in_place_stop_callback(in_place_stop_token , Callback)
5142
- -> in_place_stop_callback <Callback>;
5158
+ inplace_stop_callback(inplace_stop_token , Callback)
5159
+ -> inplace_stop_callback <Callback>;
5143
5160
}
5144
5161
</pre>
5145
5162
5146
- 1. *Mandates*: `in_place_stop_callback ` is instantiated with an argument for the
5163
+ 1. *Mandates*: `inplace_stop_callback ` is instantiated with an argument for the
5147
5164
template parameter `Callback` that satisfies both `invocable` and
5148
5165
`destructible`.
5149
5166
5150
- 2. *Remarks:* For a type `C`, if `stoppable_callback_for<Callback, in_place_stop_token ,
5167
+ 2. *Remarks:* For a type `C`, if `stoppable_callback_for<Callback, inplace_stop_token ,
5151
5168
C>` is satisfied, then `stoppable_callback_for<Callback,
5152
- in_place_stop_token , C>` is modeled. The exposition-only
5169
+ inplace_stop_token , C>` is modeled. The exposition-only
5153
5170
<i> `stop-callback`</i> member is the associated callback function
5154
- ([stoptoken.concepts] ) of `in_place_stop_callback <Callback>` objects.
5171
+ ([stoptoken.concepts] ) of `inplace_stop_callback <Callback>` objects.
5155
5172
5156
5173
Implementations are not permitted to use additional storage, such
5157
5174
as dynamic memory, to store the state necessary for an
5158
- `in_place_stop_callback `'s association with an `in_place_stop_source ` object
5175
+ `inplace_stop_callback `'s association with an `inplace_stop_source ` object
5159
5176
or to register the callback invocation with the associated
5160
- `in_place_stop_source ` object.
5177
+ `inplace_stop_source ` object.
5161
5178
5162
5179
#### Constructors and destructor <b> [stopcallback.inplace.cons] </b> #### {#spec-stopcallback.inplace.cons}
5163
5180
5164
5181
<pre highlight="c++">
5165
5182
template<class C>
5166
- explicit in_place_stop_callback(in_place_stop_token st, C&& cb)
5183
+ explicit inplace_stop_callback(inplace_stop_token st, C&& cb)
5167
5184
noexcept(is_nothrow_constructible_v<Callback, C>);
5168
5185
</pre>
5169
5186
@@ -5174,7 +5191,7 @@ template<class C>
5174
5191
([stoptoken.concepts] ).
5175
5192
5176
5193
<pre highlight="c++">
5177
- ~in_place_stop_callback ();
5194
+ ~inplace_stop_callback ();
5178
5195
</pre>
5179
5196
5180
5197
6. *Effects*: Executes a stoppable callback deregistration
@@ -6437,7 +6454,7 @@ namespace std::execution {
6437
6454
6438
6455
12. <pre highlight="c++">
6439
6456
struct <i> on-stop-request</i> { <i> // exposition only</i>
6440
- in_place_stop_source & <i> stop-src</i> ; <i> // exposition only</i>
6457
+ inplace_stop_source & <i> stop-src</i> ; <i> // exposition only</i>
6441
6458
void operator()() noexcept { <i> stop-src</i> .request_stop(); }
6442
6459
};
6443
6460
</pre>
@@ -7994,7 +8011,7 @@ namespace std::execution {
7994
8011
7995
8012
2. Let <i> `shared-env`</i> be the type of an environment such that,
7996
8013
given an instance `env`, the expression `get_stop_token(env)` is well-formed
7997
- and has type `in_place_stop_token `.
8014
+ and has type `inplace_stop_token `.
7998
8015
7999
8016
3. The names `split` and `ensure_started` denote customization point objects.
8000
8017
Let the expression <i> `shared-cpo`</i> be one of `split` or
@@ -8144,7 +8161,7 @@ namespace std::execution {
8144
8161
struct <i> env</i> { <i> // exposition only</i>
8145
8162
<i> shared-state</i> <Sndr>* <i> sh-state</i> ; <i> // exposition only</i>
8146
8163
8147
- in_place_stop_source query(get_stop_token_t) const noexcept {
8164
+ inplace_stop_source query(get_stop_token_t) const noexcept {
8148
8165
return <i> sh-state</i> ->stop_src.get_token();
8149
8166
}
8150
8167
};
@@ -8177,7 +8194,7 @@ namespace std::execution {
8177
8194
void <i> inc-ref</i> () noexcept;
8178
8195
void <i> dec-ref</i> () noexcept;
8179
8196
8180
- in_place_stop_source stop_src{};
8197
+ inplace_stop_source stop_src{};
8181
8198
<i> variant-type</i> result{};
8182
8199
<i> state-list-type</i> waiting_states;
8183
8200
<i> state-flag-type</i> completed;
@@ -8481,7 +8498,7 @@ namespace std::execution {
8481
8498
void <i> complete</i> (Rcvr& rcvr) noexcept; // see below
8482
8499
8483
8500
atomic<size_t> count{sizeof...(sndrs)};
8484
- in_place_stop_source stop_src{};
8501
+ inplace_stop_source stop_src{};
8485
8502
atomic<<i> disposition</i> > disp{<i> disposition</i> ::<i> started</i> };
8486
8503
errors_variant errors{};
8487
8504
values_tuple values{};
0 commit comments