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

Adding callback taking index and future to when_each #2189

Merged
merged 11 commits into from May 31, 2016

Conversation

ltroska
Copy link
Contributor

@ltroska ltroska commented May 29, 2016

This adds a second callback that also takes in the index of the future currently being consumed.

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.
@ltroska ltroska changed the title Adding callback taking index and future to wait_each Adding callback taking index and future to when_each May 29, 2016
template<typename F, typename... Args>
using is_callable_with =
decltype(detail::is_callable_with_impl::f<F, Args...>(0));

Copy link
Member

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.

@hkaiser hkaiser added this to the 0.9.12 milestone May 29, 2016
@hkaiser
Copy link
Member

hkaiser commented May 29, 2016

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.
@hkaiser
Copy link
Member

hkaiser commented May 30, 2016

LGTM, thanks!

@hkaiser
Copy link
Member

hkaiser commented May 30, 2016

@troska: In the test it might be appropriate to verify that the callbacks are actually called.

@ltroska
Copy link
Contributor Author

ltroska commented May 30, 2016

I think I got everything now :)

@hkaiser
Copy link
Member

hkaiser commented May 30, 2016

@ltroska Perfect, thanks!

@sithhell sithhell merged commit 597cab8 into STEllAR-GROUP:master May 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants