[英]Error while constructing std::thread using 2 argumented function
I'm creating a simple game using SFML and I got this error: 我正在使用SFML创建一个简单的游戏,但出现此错误:
"std::invoke()": no matching overloaded function found “ std :: invoke()”:找不到匹配的重载函数
Failed to specialize function template 'unknown-type std::invoke(_Callable &&,_Types &&...)' 无法专门化功能模板'unknown-type std :: invoke(_Callable &&,_ Types && ...)'
while using following code: 在使用以下代码时:
thread function: 线程功能:
void drawing(charact Hero, sf::RenderWindow window) {
while (window.isOpen()) {
window.clear();
window.draw(Hero.hitBox);
window.display();
}
}
thread declaration: 线程声明:
std::thread Draw(drawing, Hero, window);
sf::RenderWindow
is not copyable (due to inheritance of sf::NonCopyable
), hence drawing
cannot be called as-is. sf::RenderWindow
是不可复制的(由于sf::NonCopyable
继承),因此无法按原样调用drawing
。 Add a reference or use (smart) pointers. 添加引用或使用(智能)指针。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.