I want to execute DisplayWriters in another thread. Unfortunelly I am getting erorr: Invalid use of non static member function This is the code:
void Chat::Init() {
//some code
thread writersThread(Chat::DisplayWriters);
}
void Chat::DisplayWriters() {
for (auto &v : writers) {
// do stuff
}
}
I cant really do DisplayWriters static, because it is using writers list which is in Chat class. So what can I do with that?