我是C++的新手,如果能指出可能存在的问题,将不胜感激。我正在尝试使用调用函数的boost线程。我编辑了工作代码来介绍线程。在受保护的方法内提升线程功能
在.H我在.cpp文件中有
class Base: public test
{
public:
Base(string Name, string test);
virtual ~Base();
Base &operator=(const Base &other);
Base(const Base &other);
protected:
virtual void Run();
private:
void RunBasic();
void workerFunc();
}
我
void Base::Run()
{
boost::thread workerThread(workerFunc);
RunBasic();
workerThread.join();
}
void Base::workerFunc()
{
#pretending to do some work
#some functionality here
}
void Base::RunBasic()
{
#more stuff here
}
我得到一个编译错误error: no matching function for call to ‘boost::thread::thread(<unresolved overloaded function type>)’
非常感谢你们。 – user2137735 2013-03-06 18:02:08