I know this sounds silly, but look at this simple example (the working directory 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_copychanging along with it! (boost 1.45) What considerations might lead to such a design ( directory_iterator- is this something like smart ptr)?
I just need to save a copy directory_iteratorto use it later.
source
share