|
Boost Users : |
From: Brad (boost_at_[hidden])
Date: 2008-04-14 06:08:21
Daniel Krügler wrote:
> This has nothing to do with bind. As you say, begin()/end() would
> be available for a *container*, but - as the name says -
> directory_iterator is just an iterator, not a container. If you follow
> the documentation, you will find out, that the default constructed
> directory_iterator corresponds to "end" and that there exists one
> further c'tor that accepts a path - this is the one you should use
> in replacement for begin.
> For a better understanding of the idea behind that you should compare
> directory_iterator with existing std iterator adaptors, like the insert
> iterators or the stream iterators.
>
Hello Daniel,
Ahhh, the penny drops.
I have changed the code to the following and post it here for those who
may follow:
bfs::path p( "." );
bfs::directory_iterator dir_iter( p ), dir_end;
for_each( dir_iter, dir_end, boost::bind( &purgeOlder, _1 ) );
> HTH & Greetings from Bremen,
>
>
It did, many thanks from Hervey Bay, Queensland, Australia.
@Ovanes: I saw your post and appreciate the effort, thanks :-)
Cheers,
Brad
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