随笔分类 -  STL

摘要:根据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 能巴 阅读(2492) 评论(0) 推荐(1)
摘要:Codeguru has a good article: http://www.codeguru.com/cpp/cpp/cpp_mfc/stl/article.php/c4079 Part Of it: What Is an Allocator? If you take a look at the word allocator, you might already know that it ... 阅读全文
posted @ 2009-02-23 22:44 能巴 阅读(439) 评论(0) 推荐(0)
摘要:Template Instantiation The act of creating a new definition of a function, class, or member of a class from a template declaration and one or more template arguments is called template instantiation. ... 阅读全文
posted @ 2008-12-30 23:01 能巴 阅读(399) 评论(0) 推荐(0)
摘要:You may experience an access violation when you access an STL object through a pointer or reference in a different DLL or EXE. [http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b172396] On ... 阅读全文
posted @ 2008-12-30 22:39 能巴 阅读(411) 评论(0) 推荐(0)
摘要:[http://www.gotw.ca/gotw/054.htm] 另可以参考:http://blog.csdn.net/zzpzheng/archive/2006/03/27/639876.aspx Using Vector and Deque Difficulty: 8 / 10 What is the difference between vector and deque? When s... 阅读全文
posted @ 2008-11-04 10:30 能巴 阅读(479) 评论(0) 推荐(0)
摘要:学习STL map, STL set之数据结构基础 作者: winter 摘要:本文列出几个基本的STL map和STL set的问题,通过解答这些问题讲解了STL关联容器内部的数据结构,最后提出了关于UNIX/LINUX自带平衡二叉树库函数和map, set选择问题,并分析了map, set的优势之处。对于希望深入学习STL和希望了解STL map等关联容器底层数据结构的朋友来说,有一定的参考... 阅读全文
posted @ 2007-05-29 09:00 能巴 阅读(847) 评论(0) 推荐(0)