Boost logo

Boost :

From: v2cechura (v2cechura_at_[hidden])
Date: 2007-11-16 08:17:32

 [-- I crosspost this message to Boost Users List by mistake yesterday --]

I would like to suggest adding functions (template functions?) that would
return "begin" and "end" iterators for given path.
I think that it's clearer to see:

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


for_each(directory_iterator( dir_path ), directory_iterator(),

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 list run by bdawes at, gregod at, cpdaniel at, john at