c++ Boost Multithread如何将类对象传递给参数

标签 c++ boost-thread

我有类名 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/

相关文章:

c++ - 为什么我的 istream_iterator 不起作用?

c++ - 在线程退出时通知服务员

c++ - linux下用boost::thread创建boost::asio工作线程

c++ - Boost 和 Pthread 条件变量的区别

c++ - 如何在静态函数中使用成员函数数组?

c++ - libcurl (curlpp) 中的换行符问题

c++ - 使用与 new 中使用的指针类型不同的指针删除内存是否安全?

c++ - 在初始化列表中初始化许多对象成员变量

c++ - 自动生成一个值 C++

c++ - 为什么 boost::thread 构造函数不接受 boost::thread::attributes 参数?