I want to make a thread outside an int main() method; and this code below gives an error of (paraphrasing) 'no constructor found for thread for type void()'
Is there any way to accomplish threading outside the main and in a class?
Thanks,
CodeNoob117
Code:
#include <thread>;
class Board(){
//Lines Later
void getPlayerInput(){//Code NotShown}
void playGame(){
std::thread t1(getPlayerInput);//thread to get userInput
}
//Lines Later
}
Thanks,
CodeNoob117
Comment