Possible Duplicate:
Start thread with member function
While defining a thread constructor with class method in c++0x as shown below, i get function cannot be resolved. What am i doing wrong?
For example, if i have
#include <thread>
using namespace std;
class A
{
public:
void doSomething();
A();
}
Then in Class A's constructor, i want to start a thread with doSomething. If i write like below, i get error that doSomething is not resolved. I even this->doSomething.
A::A()
{
thread t(doSomething);
}