<function-style-cast>':无法从'const boost :: filesystem :: path :: value_type *'转换为'std :: string'

时间:2018-12-16 17:23:26

标签: c++ boost

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”的实例与参数列表匹配:
enter image description here

0 个答案:

没有答案