I'm trying to use std::thread in c++ without success:
A.h
class A
{
public:
A();
void MainThread();
Init();
private:
std::thread currThread;
}
A.cpp
A::A()
{
}
void A::Init()
{
currThread = std::thread(A::MainThread);
//currThread = std::thread(&MainThread);
}
void A::MainThread()
{
while (true)
{
std::cout << "Just For Example...");
}
}
I'm getting compilation error in the Init function when trying to create the thread with the MainFunction
What am I doing wrong and how can I fix it ?