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