-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
Add CPOs for for_each #4867
Add CPOs for for_each #4867
Conversation
These were used for better error messages. |
libs/algorithms/include/hpx/parallel/container_algorithms/for_each.hpp
Outdated
Show resolved
Hide resolved
2e167ee
to
0bbfb3c
Compare
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.
LGTM, thanks!
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.
LGTM thanks!
retest |
Adds CPOs for
hpx::for_each
andhpx::ranges::for_each
. As discussed earlier, I've tried to follow the return types in the standard as closely as possible (leaving out the function when an execution policy is used). The return types are adjusted only in thetag_invoke(for_each_t, ...)
overloads (unlike what I thought initially would need to be adjusted, namelystruct for_each(_n)
or theforeach
partitioner).The return types are as follows:
hpx::for_each
hpx::ranges::for_each
hpx::for_each_n
hpx::ranges::for_each_n
F
in_fun_result
iter
in_fun_result
void
iter
*iter
iter
*future<void>
*future<iter>
*future<iter>
*future<iter>
*where
iter
is the iterator type of the input or corresponding to the input range. * is not in the standard. We could keepiter
as the return type for the non-task policyhpx::for_each
, even though this is different than the standard.The iterators were restricted by
is_iterator
with SFINAE, but then in the body offor_each
there was astatic_assert(is_input/forward_iterator)
. I've change this to only useis_input/forward_iterator
in the template parameter list. Was the static assert there only for better error messages or also for some other reason?