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
[iterator.operations, range.iter.op.distance] Reword "get to". #4715
Conversation
It was previously not explicitly stated that input iterators would actually be incremented (which invalidates copies). The new wording is more explicit about how the distance is measured, and in doing so calls out more explicitly that input iterators are indeed incremented.
@CaseyCarter: I don't think either version of |
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.
Looks good for this case, but the neighboring advance
and ranges::advance
still talk about "increments i by n" for input iterators, which should get a similar treatment; maybe just "increments i n times" except that something should separate "i" and "n".
I see -- I thought we had blanket wording for the "by n" bit, but I was thinking of [algorithms.requirements]p12. I was mainly after making sure we are saying "increment" explicitly. I'm not sure if the "by n" part itself is controversial or in need of clarification. Thoughts? |
Well, I think that some of the I'm ok with forking off "advance" into a separate issue. |
LWG originally chose the "increments |
I tend to agree that "increments i by n" is clear enough; I have yet to see any confusion arising from it. Just for contrast, the linked issue shows that the lack of clarity about incrementing was indeed something that could make you wonder about what exactly is specified, but nobody has complained about "by n" yet. If anyone really wants to spend time on that, let me know, but I'd just leave it as is. |
Fine with me. |
Thanks for addressing this! |
@umanwizard: My pleasure, thanks for reporting! |
It was previously not explicitly stated that input iterators would
actually be incremented (which invalidates copies). The new wording is
more explicit about how the distance is measured, and in doing so
calls out more explicitly that input iterators are indeed incremented.
Fixes #2807.
Fixes #2813.
This is an alternative approach to #2813, as suggested by @jensmaurer in the comments.
@jwakely, @CaseyCarter, I'd welcome your review on this!