我有类名 BasicExcelCell。我用的时候是这样调用的
BasicExcelCell* c;
//Normal call
c->TTiTraceParserConv(TTiAsciiTraceOutputDL.GetBuffer(0));
//How to pass it the boost thread argument?
boost::thread t1(&YExcel::BasicExcelCell::TTiTraceParserConv,TTiAsciiTraceOutputDL.GetBuffer(0));
t1.join();
我有几种方法,但在编译时总是出错。任何建议,我很感激。我从谷歌看到了一些基本的例子。
最佳答案
您缺少要调用成员函数的实例:
This
↓
boost::thread t1(&YExcel::BasicExcelCell::TTiTraceParserConv, c, TTiAsciiTraceOutputDL.GetBuffer(0));
关于c++ Boost Multithread如何将类对象传递给参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5514730/