boost progress_display实现进度条
boost progress_display实现进度条
#include <vector>#include <boost/progress.hpp>#include <fstream>using namespace std;using namespace boost;int main(){ vector<string> v(100); for ( int i = 0; i < 10000000; ++i) { v.push_back("abcd\n"); } progress_display pd(v.size()); ofstream fs("./test.txt", ios::out ); vector<string>::iterator pos; for ( pos = v.begin(); pos != v.end(); ++pos) { fs << *pos <<endl; ++pd; } return 0;}