std::thread <unresolved overloaded function type> error
问题 I am trying to spawn a thread from within my class and the thread executes a particular method in my class. The code looks like this: class ThreadClass{ int myThread(int arg){ // do something } void createThread(){ thread t = thread(myThread,10); } } ; This code on compilation throws an error saying std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = int (ThreadClass::*)(int), _Args = {int}] no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘int