【发布时间】:2011-12-16 05:04:30
【问题描述】:
class c
{
public:
int id;
boost::thread_group thd;
c(int id) : id(id) {}
void operator()()
{
thd.create_thread(c(1));
cout << id << endl;
}
};
我创建了 c 类。每个类对象都创建线程以处理工作。但是,当我编译这个时,我收到了这个奇怪的消息
:错误 C2248:“boost::thread_group::thread_group”:无法访问在类“boost::thread_group”中声明的私有成员
此外,只是假设没有递归调用问题。
【问题讨论】:
标签: c++ multithreading boost