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

[{ex,in}clusive.scan]: Rephase 'for each *j' in terms of indexes #1210

Merged
merged 1 commit into from Dec 14, 2016

Conversation

tkoeppe
Copy link
Contributor

@tkoeppe tkoeppe commented Dec 11, 2016

Addresses #693 for this part, but is also clearer.

Exclusive:

image

Note that the range is empty when K is zero.

Inclusive:

image

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Dec 11, 2016

@zygoloid, @jfbastien, @jwakely: Could you please review this proposal?

Some variations I could think of:

  • We could say "assigns through the iterator result + K". It's redundant, but may be easier to grasp.
  • We could get rid of the list in inclusive_scan and just have two codebocks, with "if init is provided, otherwise:" in the middle.
  • We could add a note to exclusive_scan to say that the sequence is empty for K == 0. This is a common mathematical convention, though, and we are using the ellipsis in the mathematical sense here.

@timsong-cpp
Copy link
Contributor

Any changes made here should be applied to the transform_* versions as well.

@tkoeppe
Copy link
Contributor Author

tkoeppe commented Dec 11, 2016

@timsong-cpp: Thanks, done!

…ch *j' in terms of indexes

Addresses cplusplus#693 for this part, but is also clearer.
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

Successfully merging this pull request may close these issues.

None yet

3 participants