1

我有一段代码使用std::async. 这是我通过调用的函数async

cv::Mat CtVolume::prepareProjection(size_t index, FilterType filterType) const

可以看到,它的返回值为cv::Mat.

现在在我的代码中的某处,我声明了一个用于返回async调用的变量,如下所示:

std::future<cv::Mat> future;

在其他一些时候,实际的调用看起来像这样:

future = std::async(std::launch::async, &CtVolume::prepareProjection, this, projection + 1, filterType);

现在,在这一行中,IntelliSense 将等号下划线并显示以下错误消息:

IntelliSense: no operator "=" matches these operands 
operand types are: std::future<cv::Mat> = std::future<cv::Mat (&)(unsigned long long, ct::FilterType)

但是,代码编译并运行良好。现在,这只是一个 IntelliSense 问题还是我应该以不同的方式声明我的返回值?IDE 是 Visual Studio 2013。

4

0 回答 0