我似乎有一个问题,qtcreator 没有自动完成我的代码,这很烦人。
目前,当我尝试在这样的 for 循环中使用结构绑定时,它无法自动完成。
std::vector<pair<string,AudioFile<double>>> list_of_files;
// Some init of list_of_file
for (const auto& [name,file]: this->list_of_files) // red line under this.. does seem to like structure bindings?
{
file.printSummary(); // qtcreator don't offer any autocomplete options?
}
qtcreator 基本上抱怨上面发布的代码的所有内容..
但是当我这样写时:
for (int i = 0 ; i <list_of_file.size() ; i++) // No red lines under this..
{
list_of_files[i].second.printSummary() // Autocompletes without any problems.
}
qtcreator 不会抱怨这段代码,而且似乎可以自动完成它。那么为什么它会导致 c++17 风格出现这么多问题呢?
对此有任何修复吗?