I have an issue when i am trying to define new object of user class in thread.
#include stuff
class car{
string VIN;
int speed;
};
void _thread_work(){
car new_car; // <----- Here is problem
}
int main(){
std::thread _t(_thread_work);
while(1){
// another stuff here
}
return 0;
}
I tried to do it in other ways , like using C pthread , or passing class by template , using mutexes , but nothing works. Am i have misconception of how it should work?
New contributor
user25237954 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.