progress_display 可以在控制台上显示程序的执行进度,见图1-1

boost::progress_display

 

图1-1

 

 example

 1 
 2 /**
 3  * Build Success By VC++ 2010
 4  *
 5  * boost::progress_display
 6  *
 7  * copyright (C) 2010, lee
 8  */
 9 
10 #include <iostream>
11 #include <string>
12 #include <vector>
13 #include <boost/progress.hpp>
14 
15 using namespace std;
16 
17 int main()
18 {
19     vector<string> v(100);
20 
21     boost::progress_display pd(v.size());
22 
23     vector<string>::iterator pos;
24     for (pos = v.begin(); pos != v.end(); ++pos)
25     {
26         ++pd; // 重载的 ++ 操作符,增加计数并输出当前进度。
27     }
28 
29     return 0;
30 }
31 

 

 

 

相关文章:

  • 2021-11-14
  • 2021-11-01
  • 2021-08-13
  • 2021-07-21
  • 2021-04-07
  • 2022-02-04
猜你喜欢
  • 2021-11-06
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2021-11-01
  • 2022-12-23
相关资源
相似解决方案