how to make a copy of boost::filesystem::directory_iterator?
I know this sounds stupid, but look at this simple example (working dir should have more than one item): #define BOOST_FILESYSTEM_VERSION 3 #include <boost/filesystem.hpp> #include <cassert> int main() { using namespace boost::filesystem; directory_iterator it("./"); directory_iterator it_copy = it; ++it; assert(it_copy != it); return 0; } it_copy is modified together with it ! (boost 1.45) What considerations could lead to such design ( directory_iterator is something like smart ptr)? I just need to save a copy of directory_iterator to use it later. If you take a look at the reference you