I am iterating through a directory, and when an item matches some criteria, I delete it. Can I do it safely from within the loop, or to I have to save paths in an array and delete then later?

I did not find a relevant information in [boost::filesystem docs](http://www.boost.org/doc/libs/1_52_0/libs/filesystem/doc/index.htm).