I understand from my previous query that it migth not be possible to create a std::thread without initialization.
BUt WRT below code snippet, I see I'm not even able to create a std::thread even with initialization as a data member of a class/struct in C++.
It complains with compilation error "Function threadfunction is not a type name", irrespective if the function is within class/struct or outside (global). Please refer below example. Seems like there is some rivalry between class/struct and std::threads. Seeing so much of issues.
int f1234()
{
std::cout<""f1234";
}
struct Abc
{
int a;
void mem1()
{
printf("mem1\n");
}
std::thread mt(f1234); // Function f1234 is not a type name
std::thread mt1(mem1); // Function mem1 is not a type name
}