#include <iostream>
#include <boost/thread/thread.hpp>
class TestThreadRun{
public:
TestThreadRun(){};
virtual ~TestThreadRun() {} //!< Empty Destructor.
void operator()()
{
run();
}
void run()
{
std::cout<<"TestThreadRun::run()"<<std::endl;
}
};
int main(int argc, char* argv[])
{
TestThreadRun *threadRun = new TestThreadRun();
boost::thread *testThread = new boost::thread( *threadRun );
testThread->join();
return 0;
}
[color=red][size=xx-medium]Result:
TestThreadRun::run()[/size][/color]