-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Modernize ranges::for_each #1060
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
Conversation
|
Urgh I think adding |
Yes: |
StephanTLavavej
left a comment
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.
One comment nitpick, otherwise looks great!
| assert(ranges::equal(expected, input)); | ||
|
|
||
| int some_value = 1729; | ||
| result.fun(some_value); |
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 observe that this test verifies that result.fun is invocable, but not that it actually contains the state accumulated by being invoked on each element. (An incorrect implementation could return a copy of the original callable object.) No change requested.
|
Thanks for modernizing each of these algorithms. |
This modernizes
ranges::for_eachandranges::for_each_nto the current state of the art