摘要: 根据effective STL的rule,从效率和正确性角度考虑,使用STL的算法要比自己写循环遍历要effective。之前一直没讲究过这个。从现在起,要注意起来了。先学起来下面三个1. find2. find_if 3. for_each它们都会用到mem_fun, mem_fun1(可以接受一个参数),bind2nd(ptr_fun(funcName), argument)。详见下面的例子(来自:http://www.builder.com.cn/2008/0129/723326.shtml) 比如我们有下面的类: classClxECS{public:intDoSomething(). 阅读全文
posted @ 2011-07-19 17:37 能巴 阅读(2441) 评论(0) 推荐(1) 编辑