错误C2893无法专用于功能模板'unknown-type std :: invoke(_Callable&&,_ Types&& ...)' [英] Error C2893 Failed to specialize function template 'unknown-type std::invoke(_Callable &&,_Types &&...)'

查看:180
本文介绍了错误C2893无法专用于功能模板'unknown-type std :: invoke(_Callable&&,_ Types&& ...)'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2015项目的C ++类中使用std :: thread.

I use std::thread in my C++ class in my Visual Studio 2015 project.

class BaggageSoln {
        void mainProcess();
        // Threading functions
        void run();
        void startZED();        
        void closeZED();
private:
        std::thread zed_callback;

}

void BaggageSoln::startZED()
{
    // Start the thread for grabbing ZED data
    has_data = false;
    zed_callback = std::thread(&BaggageSoln::run);

    //Wait for data to be grabbed
    while (!has_data)
        sleep_ms(1);
}

void BaggageSoln::mainProcess() {}
void BaggageSoln::run() {}
void BaggageSoln::closeZED(){}

第238行的xthread文件发生错误. 有什么问题吗?

Error is happening at xthread file at line 238. What could be wrong?

推荐答案

&BaggageSoln::run要求调用一个实例,将其设置为static或提供一个实例.

&BaggageSoln::run requires an instance to be called, make it static or provide an instance.

zed_callback = std::thread(&BaggageSoln::run, this);

这篇关于错误C2893无法专用于功能模板'unknown-type std :: invoke(_Callable&&,_ Types&& ...)'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆