-
Notifications
You must be signed in to change notification settings - Fork 335
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
How to pass function of classe #22
Comments
|
I was able to do such a thing without using static. Just do something like this:
Then you can push to the thread pool:
I don't know if it is the optimal way to do this, but it works for me. |
If you read the example.cpp carefully, you should see that there is an Just add an I don't know why, but CTPL requires all functions being pushed into the thread pool having an int argument as its first argument, regardless of the number of arguments actually used in the function. |
I have this class
I do
MyTask task; ctpl::thread_pool testThreadPool(4);
How can I push
task.run()
toctpl::thread_pool
?testThreadPool.push(task.run);
, isn't correctThe text was updated successfully, but these errors were encountered: