Threading Static Templated Member Function In Template Class
I'm kinda stuck on this.
template <int A> struct X
template <int B>
static void function()
std::cout << "function\n";
int main(int argc, char **argv)
X<0>::function<1>(); // Compiles OK
std::thread(X<0>::function<1>).join(); // Error: invalid declaration of ‘X<0>::function<1>’|
I tried many different combinations and googled a lot.
Just want to thread the static member function, any fix?
Providing an argument makes it work. Why? How can I avoid having to pass an argument?
Well I fixed it myself using a lambda instead... Works for me, but still it'd be cleaner if it were possible to directly go through the thread's constructor. Oh well, this will do for now.
Last edited on
Topic archived. No new replies allowed.