我在Ubuntu 12.04上使用GCC(4.6.3)编译器。我尝试初始化boost :: thread的向量(使用boost ver:1.54.0),但我得到了一个奇怪的错误:
#include <iostream>
#include <vector>
#include <boost/thread/thread.hpp>
int main()
{
std::vector<boost::thread> list_threads(10);
return 0;
}
这是我的错误信息:
/ usr / include / c ++ / 4.6 / bits / stl_construct.h:84:错误:传递&#39; const 提高::线程&#39;作为&#39;这个&#39; &boost; thread :: thread ::运算符的参数 升压::详细:: thread_move_t()&#39;丢弃限定符 [-fpermissive]
如何解决这个问题?我希望我不是那个唯一的人:p
有关信息,此代码在mcsv2010上编译。
谢谢