我有这个班级
class ConnectionManager()
{
public:
void Receive(); /* This method uses variables from this class */
}
void _tmain()
{
ConnectionManager* m_pConnectionManager = new ConnectionManager();
/* the thread should be called here */
}
如何创建使用m_pConnectionManager对象中的receive方法的线程?我似乎无法通过Stackoverflow上的其他问题弄清楚这一点。 我试过这个,但它不起作用:
std::thread receiveThread(&ConnectionManager::Receive);
我收到此错误:
error C2064: term does not evaluate to a function taking 0 arguments c:\program files (x86)\microsoft visual studio 11.0\vc\include\functional