-
Notifications
You must be signed in to change notification settings - Fork 249
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
use pool in class/struct #48
Comments
There are two issues here:
So in other words, you need to declare the pool in your class as follows: inline static BS::thread_pool pool {0}; Specifying |
thanks for your help. 👍 |
No problem! In the next release I will remove the |
I'd like to use thread_pool as a static struct/class member, for a test demo code like
compile with
g++ bs_thread_pool.cpp -std=c++17 -pthread -o bs_thread_pool.cpp.o
I got errors like
the testfunc() in my code must be static so I cannot let
pool
be no-static. It seems that the declaration and instantiation ofpool
are bound. And I think the error is independent with OS or g++/clang++ version. Do you have any idea about this situation? Maybe I made some stupid mistakethe thread_pool version is the latest 3.0.0
The text was updated successfully, but these errors were encountered: