Skip to content

Commit e9dbf6a

Browse files
committed
rename in_place_* to inplace_*_
1 parent 51ae015 commit e9dbf6a

File tree

1 file changed

+85
-68
lines changed

1 file changed

+85
-68
lines changed

execution.bs

Lines changed: 85 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,20 +1503,37 @@ The changes since R8 are as follows:
15031503

15041504
<b>Fixes:</b>
15051505

1506-
* The `tag_invoke` mechanism has been replace with member functions
1506+
* The `tag_invoke` mechanism has been replaced with member functions
15071507
for customizations as per \[P2855](https://wg21.link/p2855).
15081508

15091509
* Per guidance from LWG and LEWG, `receiver_adaptor` has been removed.
15101510

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
15121512
`final`. Without `receiver_adaptor` and `tag_invoke`, receiver adaptors
15131513
are easily written using implementation inheritance.
15141514

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+
15151521
<b>Enhancements:</b>
15161522

15171523
* The specification of the `sync_wait` algorithm has been updated
15181524
for clarity.
15191525

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+
15201537
## R8 ## {#r8}
15211538

15221539
The changes since R7 are as follows:
@@ -2407,8 +2424,8 @@ cancellation include:
24072424
different implementation strategies.
24082425
* Add `std::unstoppable_token` concept for detecting whether a `stoppable_token`
24092426
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
24122429
implementation of a stop-token for use in structured concurrency situations.
24132430
* Add `std::never_stop_token` for use in places where you never want to issue a
24142431
stop-request.
@@ -3968,9 +3985,9 @@ a new bullet as follows:</span>
39683985

39693986
<div class="block-insert">
39703987
* 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],
39723989
[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],
39743991
[stopcallback.inplace.cons]) when a callback invocation exits via an
39753992
exception.
39763993

@@ -4162,8 +4179,8 @@ the new `stoppable_source` concept.</span>
41624179
The last remaining owner of the stop state automatically releases the
41634180
resources associated with the stop state.
41644181

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
41674184
counting of the stop state. They are for use when the lifetimes of the tokens
41684185
and the callbacks are known to nest within the lifetime of the source.
41694186

@@ -4207,15 +4224,15 @@ namespace std {
42074224
<div class="block-insert"> <i>// [stoptoken.never], class never_stop_token</i>
42084225
class never_stop_token;
42094226

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

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

4216-
<i>// [stopcallback.inplace], class template in_place_stop_callback</i>
4233+
<i>// [stopcallback.inplace], class template inplace_stop_callback</i>
42174234
template&lt;class Callback>
4218-
class in_place_stop_callback;
4235+
class inplace_stop_callback;
42194236

42204237
template&lt;class T, class Callback>
42214238
using stop_callback_for_t = T::template callback_type&lt;Callback>;</div>
@@ -4961,44 +4978,44 @@ explicit stop_callback(stop_token&& st, C&& cb)
49614978
</div>
49624979
</div>
49634980

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`
49654982
<b>[stoptoken.inplace]</b>, after the subclause added above, as a new subclause
49664983
of Stop tokens <b>[thread.stoptoken]</b>.</span>
49674984
<div class="standardeze">
49684985
<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}
49704987

49714988
#### General <b>[stoptoken.inplace.general]</b> #### {#spec-stoptoken.inplace.general}
49724989

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
49754992
([stopsource.inplace]), if any.
49764993

49774994
<pre highlight="c++">
49784995
namespace std {
4979-
class in_place_stop_token {
4996+
class inplace_stop_token {
49804997
public:
49814998
template&lt;class CB>
4982-
using callback_type = in_place_stop_callback&lt;CB>;
4999+
using callback_type = inplace_stop_callback&lt;CB>;
49835000

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

49875004
// [stoptoken.inplace.mem], member functions
49885005
bool stop_requested() const noexcept;
49895006
bool stop_possible() const noexcept;
4990-
void swap(in_place_stop_token&) noexcept;
5007+
void swap(inplace_stop_token&) noexcept;
49915008

49925009
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>
49945011
};
49955012
}
49965013
</pre>
49975014

49985015
#### Member functions <b>[stoptoken.inplace.members]</b> #### {#spec-stoptoken.inplace.members}
49995016

50005017
<pre highlight="c++">
5001-
void swap(in_place_stop_token& rhs) noexcept;
5018+
void swap(inplace_stop_token& rhs) noexcept;
50025019
</pre>
50035020

50045021
1. *Effects*: Exchanges the values of <i>`stop-source`</i> and
@@ -5013,7 +5030,7 @@ bool stop_requested() const noexcept;
50135030

50145031
2. <span class="wg21note">As specified in [basic.life], the behavior of
50155032
`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
50175034
any.</span>
50185035

50195036
<pre highlight="c++">
@@ -5025,41 +5042,41 @@ bool stop_possible() const noexcept;
50255042
4. <span class="wg21note">As specified in [basic.stc.general], the behavior of
50265043
`stop_possible()` is implementation-defined unless the call strongly happens
50275044
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>
50295046

50305047
</div>
50315048
</div>
50325049

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`
50345051
<b>[stopsource.inplace]</b>, after the subclause added above, as a new subclause
50355052
of Stop tokens <b>[thread.stoptoken]</b>.</span>
50365053
<div class="standardeze">
50375054
<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}
50395056

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

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
50445061
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.
50475064

50485065
<pre highlight="c++">
50495066
namespace std {
5050-
class in_place_stop_source {
5067+
class inplace_stop_source {
50515068
public:
50525069
// [stopsource.inplace.cons], constructors, copy, and assignment
5053-
in_place_stop_source() noexcept;
5070+
inplace_stop_source() noexcept;
50545071

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();
50605077

50615078
//[stopsource.inplace.mem], stop handling
5062-
in_place_stop_token get_token() const noexcept;
5079+
inplace_stop_token get_token() const noexcept;
50635080
static constexpr bool stop_possible() noexcept { return true; }
50645081
bool stop_requested() const noexcept;
50655082
bool request_stop() noexcept;
@@ -5070,7 +5087,7 @@ of Stop tokens <b>[thread.stoptoken]</b>.</span>
50705087
#### Constructors, copy, and assignment <b>[stopsource.inplace.cons]</b> #### {#spec-stopsource.inplace.cons}
50715088

50725089
<pre highlight="c++">
5073-
in_place_stop_source() noexcept;
5090+
inplace_stop_source() noexcept;
50745091
</pre>
50755092

50765093
1. *Effects*: Initializes a new stop state inside `*this`.
@@ -5080,10 +5097,10 @@ in_place_stop_source() noexcept;
50805097
#### Members <b>[stopsource.inplace.mem]</b> #### {#spec-stopsource.inplace.mem}
50815098

50825099
<pre highlight="c++">
5083-
in_place_stop_token get_token() const noexcept;
5100+
inplace_stop_token get_token() const noexcept;
50845101
</pre>
50855102

5086-
1. *Returns*: A new associated `in_place_stop_token` object.
5103+
1. *Returns*: A new associated `inplace_stop_token` object.
50875104

50885105
<pre highlight="c++">
50895106
bool stop_requested() const noexcept;
@@ -5104,12 +5121,12 @@ bool request_stop() noexcept;
51045121
</div>
51055122

51065123
<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
51085125
added above, as a new subclause of Stop tokens <b>[thread.stoptoken]</b>.</span>
51095126
<div class="standardeze">
51105127
<div class="block-insert">
51115128

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}
51135130

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

@@ -5118,52 +5135,52 @@ added above, as a new subclause of Stop tokens <b>[thread.stoptoken]</b>.</span>
51185135
<pre highlight="c++">
51195136
namespace std {
51205137
template&lt;class Callback>
5121-
class in_place_stop_callback {
5138+
class inplace_stop_callback {
51225139
public:
51235140
using callback_type = Callback;
51245141

51255142
// [stopcallback.inplace.cons], constructors and destructor
51265143
template&lt;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)
51285145
noexcept(is_nothrow_constructible_v&lt;Callback, C>);
5129-
~in_place_stop_callback();
5146+
~inplace_stop_callback();
51305147

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

51365153
private:
51375154
Callback <i>stop-callback</i>; <i>// exposition only</i>
51385155
};
51395156

51405157
template&lt;class Callback>
5141-
in_place_stop_callback(in_place_stop_token, Callback)
5142-
-> in_place_stop_callback&lt;Callback>;
5158+
inplace_stop_callback(inplace_stop_token, Callback)
5159+
-> inplace_stop_callback&lt;Callback>;
51435160
}
51445161
</pre>
51455162

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
51475164
template parameter `Callback` that satisfies both `invocable` and
51485165
`destructible`.
51495166

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,
51515168
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
51535170
<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.
51555172

51565173
Implementations are not permitted to use additional storage, such
51575174
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
51595176
or to register the callback invocation with the associated
5160-
`in_place_stop_source` object.
5177+
`inplace_stop_source` object.
51615178

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

51645181
<pre highlight="c++">
51655182
template&lt;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)
51675184
noexcept(is_nothrow_constructible_v&lt;Callback, C>);
51685185
</pre>
51695186

@@ -5174,7 +5191,7 @@ template&lt;class C>
51745191
([stoptoken.concepts]).
51755192

51765193
<pre highlight="c++">
5177-
~in_place_stop_callback();
5194+
~inplace_stop_callback();
51785195
</pre>
51795196

51805197
6. *Effects*: Executes a stoppable callback deregistration
@@ -6437,7 +6454,7 @@ namespace std::execution {
64376454

64386455
12. <pre highlight="c++">
64396456
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>
64416458
void operator()() noexcept { <i>stop-src</i>.request_stop(); }
64426459
};
64436460
</pre>
@@ -7994,7 +8011,7 @@ namespace std::execution {
79948011

79958012
2. Let <i>`shared-env`</i> be the type of an environment such that,
79968013
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`.
79988015

79998016
3. The names `split` and `ensure_started` denote customization point objects.
80008017
Let the expression <i>`shared-cpo`</i> be one of `split` or
@@ -8144,7 +8161,7 @@ namespace std::execution {
81448161
struct <i>env</i> { <i>// exposition only</i>
81458162
<i>shared-state</i>&lt;Sndr>* <i>sh-state</i>; <i>// exposition only</i>
81468163

8147-
in_place_stop_source query(get_stop_token_t) const noexcept {
8164+
inplace_stop_source query(get_stop_token_t) const noexcept {
81488165
return <i>sh-state</i>->stop_src.get_token();
81498166
}
81508167
};
@@ -8177,7 +8194,7 @@ namespace std::execution {
81778194
void <i>inc-ref</i>() noexcept;
81788195
void <i>dec-ref</i>() noexcept;
81798196

8180-
in_place_stop_source stop_src{};
8197+
inplace_stop_source stop_src{};
81818198
<i>variant-type</i> result{};
81828199
<i>state-list-type</i> waiting_states;
81838200
<i>state-flag-type</i> completed;
@@ -8481,7 +8498,7 @@ namespace std::execution {
84818498
void <i>complete</i>(Rcvr& rcvr) noexcept; // see below
84828499

84838500
atomic&lt;size_t> count{sizeof...(sndrs)};
8484-
in_place_stop_source stop_src{};
8501+
inplace_stop_source stop_src{};
84858502
atomic&lt;<i>disposition</i>> disp{<i>disposition</i>::<i>started</i>};
84868503
errors_variant errors{};
84878504
values_tuple values{};

0 commit comments

Comments
 (0)