Skip to content
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

[2018-06 LWG Motion 19] P0769R2 Add shift to <algorithm> #2136

Closed
jensmaurer opened this issue Jun 9, 2018 · 2 comments
Closed

[2018-06 LWG Motion 19] P0769R2 Add shift to <algorithm> #2136

jensmaurer opened this issue Jun 9, 2018 · 2 comments
Assignees
Milestone

Comments

@jensmaurer
Copy link
Member

No description provided.

@jensmaurer jensmaurer added this to the post-2018-06 milestone Jun 9, 2018
@timsong-cpp
Copy link
Contributor

timsong-cpp commented Jun 11, 2018

This one needs some fixes:

  • shift_left's Returns: uses the expression first + (last - first) - n, this should be reparenthesized to first + (last - first - n) or first + ((last - first) - n). There's no library wording defining a - n for forward iterators.
  • We don't have a CamelCased BidirectionalIterator requirement, so shift_right's "the BidirectionalIterator requirements" (in both the Requires and Effects paragraphs) should be "the requirements of a bidirectional iterator", with a cross-reference to [bidirectional.iterators].

@jensmaurer jensmaurer self-assigned this Jun 11, 2018
@AlisdairM
Copy link
Contributor

We use iterator arithmetic, even for forward iterators, where the semantics are clear. Every so often there are attempts to clean it up, but if precision comes at the cost of too much clarity, the shorthand usually wins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants