I have a c++ code which runs through about 200 ASCII files, does some basic data processing, and outputs a single ASCII file with (basically) all of the data.
The progra
This is a total shot in the dark. You've got:
bool getDirectoryContents(const string dirName, vector *conts) {
...
copy(directory_iterator(p), directory_iterator(), back_inserter(v));
How does the performance change if you instead make that:
bool getDirectoryContents(const string dirName, vector *conts) {
...
// note: preincrementing the iterator
for (directory_iterator it((p)); it!=directory_iterator(); ++it) {
v.push_back(*it);
}
My thought is that std::copy
is specified to use postincrement. And boost::filesystem::directory_iterator
is an InputIterator: it shouldn't really support postincrement. boost::filesystem::directory_iterator
may not be happy being postincremented.