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
Adding callback taking index and future to when_each #2189
Conversation
This trait checks if a type is callable with a given set of parameter types.
Added a second callback to when_each (and derivates) that takes the index of the future being consumed and the future itself as parameters.
template<typename F, typename... Args> | ||
using is_callable_with = | ||
decltype(detail::is_callable_with_impl::f<F, Args...>(0)); | ||
|
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.
Please don't use 'using' directives in HPX (yet). Some compilers we use don't fully support this feature.
Could you add a test verifying your code works as expected, please? |
If two futures of the same type are passed into when_each individually the compiler picks the iterator version which fails to compile since a future is not an iterator.
LGTM, thanks! |
@troska: In the test it might be appropriate to verify that the callbacks are actually called. |
I think I got everything now :) |
@ltroska Perfect, thanks! |
This adds a second callback that also takes in the index of the future currently being consumed.