How it works...
Functions and classes of Boost.Filesystem just wrap around system-specific functions to work with files.
Note the usage of / in step 2. POSIX systems use a slash to specify paths; Windows, by default, uses backslashes. However, Windows understands forward slashes too, so ./ will work on all the popular operating systems, and it means the current directory.
Take a look at step 3, where we are default constructing the boost::filesystem::directory_iterator class. It works just like a std::istream_iterator class, which acts as an end iterator when default constructed.
Step 4 is a tricky one, not because this function is hard to understand, but because lots of conversions are happening. Dereferencing the begin iterator returns ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access