- 注册时间
- 2011-3-6
- 最后登录
- 1970-1-1
该用户从未签到
|
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:ut );
vector<string>::iterator pos;
for ( pos = v.begin(); pos != v.end(); ++pos)
{
fs << *pos <<endl;
++pd;
}
return 0;
}[/code] |
|