使用2参数函数构造std::线程时出错
Error while constructing std::thread using 2 argumented function
我正在使用SFML创建一个简单的游戏,我得到了这个错误:
std::invoke()":没有匹配的重载函数
特化函数模板失败'unknown-type std::invoke(_Callable &&,_Types &&…)'
同时使用以下代码:
线程函数:void drawing(charact Hero, sf::RenderWindow window) {
while (window.isOpen()) {
window.clear();
window.draw(Hero.hitBox);
window.display();
}
}
线程声明:std::thread Draw(drawing, Hero, window);
sf::RenderWindow
是不可复制的(由于sf::NonCopyable
的继承),因此drawing
不能按原样命名。添加引用或使用(智能)指针
相关文章:
- 使用 thread 类在 C++ 中构造线程的动态数组时出错
- C++ 线程时出错,标准::调用:
- 混合开放MP/MPI代码中的多线程发送/接收时出错
- 将工作线程信号与主窗口插槽 (Qt5) 连接时出错
- std::c++ 中的线程在设置线程函数时不会出错
- std::move在将std::string移动到另一个线程时出错
- 编译类 C++ 中的线程时出错(错误 xthread)
- 在C++中创建线程时出错
- 在另一个线程正在运行的情况下退出应用程序时出错
- 在 Ubuntu 13.10 x64 C++11 中创建 std::线程时出错
- 提升时出错"member function redeclaration not allowed":线程
- 多个线程无法访问同一个指针而不会出错
- MFC 编程:编译时出错:线程代码中的错误
- 线程不刷新数据,在屏幕中显示数据时出错
- 线程调用类函数时出错
- JNI GetMethodID导致本机线程出错
- 读取线程应用程序(linux,pthreads)中的文件大小时出错
- 使用类函数创建线程时出错
- 在c++中创建简单线程时出错
- 在代码块中编译线程程序时出错