-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
It would be useful to specify in the documentation that, when submitting tasks, arguments are passed by value by default (see std::bind()), which can significantly slow down the pool.
And that one should use std::ref() to pass arguments by reference, such as:
auto my_future = pool.submit(task, arg1, std::ref(arg2));
It would be convenient if there was a way for arguments to be passed by reference automatically when the function definition specifies it, but not sure how to do it.
chendashenxian
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working