开发者

Problem when using recursive_directory_iterator()

开发者 https://www.devze.com 2023-02-28 13:52 出处:网络
Why when I try to iterate all directories and subdirectories of a pa开发者_C百科rtition using recursive_directory_iterator() from Boost, when it reaches the end, Visual Studio 2010 gives me an Abort e

Why when I try to iterate all directories and subdirectories of a pa开发者_C百科rtition using recursive_directory_iterator() from Boost, when it reaches the end, Visual Studio 2010 gives me an Abort error ?

path Path = "e:\\";
for(recursive_directory_iterator it(Path); it != recursive_directory_iterator(); ++it)
{
    cout << *it << endl;
}


What version of Boost are you using? There was a bug related to empty directories until 1.35: https://svn.boost.org/trac/boost/ticket/1061

Is your directory (sometimes) empty?

0

精彩评论

暂无评论...
验证码 换一张
取 消