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

enqueue: provide variadic function #6

Closed
daniel-j-h opened this issue Feb 23, 2013 · 1 comment
Closed

enqueue: provide variadic function #6

daniel-j-h opened this issue Feb 23, 2013 · 1 comment

Comments

@daniel-j-h
Copy link

For now we're able to enqueue e.g. lambdas, or use std::bind to curry functions taking various arguments.

It would be reasonable to provide a variadic enqueue instead, taking various arguments and simply passing them on, e.g.

template<typename Function, typename... Args>
auto enqueue(Function&& f, Args&&... args) -> std::future<decltype(std::forward<F>(f)(std::forward<Args>(args)...))>;

The behavior should be similar to e.g. std::thread's interface.

@progschj
Copy link
Owner

I tried adding this in the develop branch. But since packaged_task doesn't actually package arguments I ended up using bind internally anyway. There may be a better way I don't know about though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants