摘要: “Make simple things easy.” -- Larry Wall c++中,写一个循环去迭代一个序列是很单调的。1 string hello("hello, boost!");2 3 for (int i = 0; i != hello.size(); ++i) 4 { 5 cout<<hello.at(i); 6 } 我们可以用std:for_each,但是这样并没有减少代码了,而且让很多功能分离太远 1 void print (char ch) 2 { 3 cout << ch; 4 } 5 int _tmain(int argc 阅读全文
posted @ 2011-05-30 11:42 sld666666 阅读(1962) 评论(2) 推荐(0) 编辑