Boost logo

Boost Users :

From: v2cechura (v2cechura_at_[hidden])
Date: 2007-11-14 10:46:45


 
I would suggest introduction of (template) functions that would return
"begin" and "end" directory iterators.

I think that it's clearer to see:

for_each(directory_begin( dir_path ), directory_end(), do_something());

than

for_each(directory_iterator( dir_path ), directory_iterator(),
do_somethig());

The functions directory_begin()/directory_end() would mimic the convenient
container.begin()/container.end() functions used in STL.
I know that it's merely a decoration but so is std::make_pair.

It could just be:

template <class Path>
inline class basic_directory_iterator<Path> directory_begin(const Path& dp)
{ return basic_directory_iterator<Path>(dp); }

template <class Path>
inline class basic_directory_iterator<Path> directory_end() { return
basic_directory_iterator<Path>(); }

Vaclav Cechura


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net