Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1265

Answer by HolyBlackCat for Is the ordering of std::recursive_directory_iterator specified?

$
0
0

It's guaranteed to be depth-first traversal. (But the file order in each individual directory is of course unspecified.)

The first hint is the existence of .disable_recursion_pending(). It would be hard to implement for a non-DFS approach (you'd have to store an array of bools for the current directory?).

Then there's [fs.rec.dir.itr.members]/21 that directly requires what is essentially DFS.


Viewing all articles
Browse latest Browse all 1265

Trending Articles