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

hpx::wait should operate on boost::arrays and std::lists #570

Closed
brycelelbach opened this issue Oct 13, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@brycelelbach
Copy link
Member

commented Oct 13, 2012

It'd be cool if hpx::wait worked on boost::array (of futures) and std::lists (of futures). Alternatively, we could SFINAE it, but I'd rather not go that route as SFINAE can be brittle.

@hkaiser

This comment has been minimized.

Copy link
Member

commented Oct 13, 2012

If we can detect containers we can do it. I suppose the is_container trait as used in Spirit should be good enough. Perhaps something like:

template <typename T, typename Iterator>
future<T> wait_all (Iterator begin, Iterator end)
{
     // rewrite the when_all engine to work with iterators instead
}

template <typename T>
typename enable_if<
    is_container<T> && is_future<typename T::value_type>,
    future<T> >::type
when_all (T const& lazy_values)
{
    return when_all<T>(begin(lazy_values), end(lazy_value));
}

All of this should be done to when_all/wait_all, when_any/wait_any, and when_n/wait_n,

@ghost ghost assigned hkaiser Oct 13, 2012

@hkaiser

This comment has been minimized.

Copy link
Member

commented Oct 13, 2012

See also #573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.