-
Notifications
You must be signed in to change notification settings - Fork 778
[coro.generator] Editorial fixes #6230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15835,11 +15835,11 @@ | |
Initializes \exposid{coroutine_} with | ||
\tcode{exchange(other.\exposid{coroutine_}, \{\})} and | ||
\exposid{active_} with | ||
\tcode{exchange(\brk{}other.active_, nullptr)}. | ||
\tcode{std::move(\brk{}other.active_)}. | ||
|
||
\pnum | ||
\begin{note} | ||
Iterators previously obtained from \tcode{other} are not invalidated; | ||
Iterators previously into \tcode{other} are not invalidated; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new phrasing doesn't read like English to me. Also, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that "iterators (previously) into X" is a little vague. Other places (e.g. https://eel.is/c++draft/associative.reqmts.general#115.sentence-2 ) use "iterators pointing to elements of X", but we can't do that here because generators don't have elements. The phrase "iterators into X" is used in https://eel.is/c++draft/sequence.reqmts#37.sentence-3 , as well as on the left-hand side of this diff. This note could be updated to say "this operation does not modify any iterator Re |
||
they become iterators into \tcode{*this}. | ||
\end{note} | ||
\end{itemdescr} | ||
|
@@ -15889,7 +15889,7 @@ | |
|
||
\pnum | ||
\begin{note} | ||
Iterators previously obtained from \tcode{other} are not invalidated; | ||
Iterators previously into \tcode{other} are not invalidated; | ||
they become iterators into \tcode{*this}. | ||
\end{note} | ||
\end{itemdescr} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is beneficial to keep the consistency of always using
exchange
when defining a move constructor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only place in "ranges.tex" where
exchange(
is mentioned. Every other place where we define a move-constructor, we usestd::move
; e.g. https://eel.is/c++draft/range.elements.iterator#5.sentence-1 , https://eel.is/c++draft/range.elements#sentinel-2.sentence-1 , https://eel.is/c++draft/range.take.while.sentinel#2 , https://eel.is/c++draft/range.adjacent.sentinel#2 , ...I'm not familiar with any other place in the standard that uses
exchange
when it doesn't need to.git grep 'Initializes.*exchange'
has zero hits.git grep '\(^\|with \).tcode.exchange'
has only three hits, all in this paragraph.