I tried the next code:
class JustClass
{
public:
void JustFunc()
{
std::thread t(this->JustThread);
t.detach();
}
void JustThread()
{
}
private:
};
It should not do any problems. I just call a function of my object to act like a thread. But I get the next error fot this:
But if Im doing that:
class JustClass
{
public:
void JustFunc()
{
std::thread t(this->JustThread, 5);
t.detach();
}
void JustThread(int just_var)
{
}
private:
};
Then now I get this Eroor:
Error 2 error C3867: 'JustClass::JustThread': function call missing argument list; use '&JustClass::JustThread' to create a pointer to member c:\users\micha\onedrive\מסמכים\visual studio 2013\projects\project2\project2\source.cpp 58 1 Project2
Why is that weird behavior?