【发布时间】:2014-06-27 09:16:34
【问题描述】:
我只是想创建一个std::vector 的线程并运行它们。
代码:
thread t1(calc, 95648, "t1");
thread t2(calc, 54787, "t2");
thread t3(calc, 42018, "t3");
thread t4(calc, 75895, "t4");
thread t5(calc, 81548, "t5");
vector<thread> threads { t1, t2, t3, t4, t5 };
错误:“function std::thread::thread(const std::thread &)”(在“C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\thread”的第 70 行声明) 不能被引用——它是一个被删除的函数
thread(const thread&) = delete;
似乎是什么问题?
【问题讨论】:
标签: c++