首页 > 解决方案 > ': 无法从 'const boost::filesystem::path::value_type *' 转换为 'std::string'

问题描述

void loadImages(const string& src, vector<string> &dest){

directory_iterator end;

path dir(src);

string filename;
int n = 0;
int num;

for (directory_iterator pos(dir); pos != end; ++pos) {
    if (is_regular_file(*pos)) {
        n++;
    }
}

dest.resize(n);

for (directory_iterator pos(dir); pos != end; ++pos) {
    if (is_regular_file(*pos)) {
        filename = pos->path().filename().string();
        num = atoi((filename.substr(0, filename.find("."))).c_str());
        dest[num - 1] = pos->path().string();
    }
}

}

我该如何解决这个错误加上有 2 个错误:E0308 多个重载函数“is_regular_file”实例与参数列表匹配:
在此处输入图像描述

标签: c++boost

解决方案


推荐阅读