由于未知原因,创建线程无法正常工作(C ++)

时间:2019-01-17 09:06:08

标签: c++ multithreading

我一直在寻找用于在c ++中创建和使用线程的简单工具,最后决定使用std::thread。我从另一个stackoverflow贡献中获得了语法。但是由于某种原因,在尝试使用它时出现此错误:

  

严重性代码描述项目文件行抑制状态   错误C2893无法专门化功能模板'unknown-type   std :: invoke(_Callable &&,_ Types && ...)   noexcept()'台球c:\ program files(x86)\ microsoft visual   studio \ 2017 \ enterprise \ vc \ tools \ msvc \ 14.15.26726 \ include \ thr \ xthread 238

代码

 void CBilliardView::OnNew()
 {

     pDoc->bullets.push_back(Bullet());

     std::thread t1(&CBilliardView::NewThread);

     return;
 }

 void CBilliardView::NewThread()
 {

 }

我在做什么错?

0 个答案:

没有答案
相关问题