![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
STL学习
文章平均质量分 79
fdvfdvdxv
这个作者很懒,什么都没留下…
展开
-
STL学习笔记之STL介绍(上)
STL是一些容器(list、vector、map等)的集合,也是算法和一些组件的集合。 定义一个list #include #include int main (void) { list Milkshakes; return 0; } 使用list函数的push_back(插入到对象尾部)和push_front(插入到对象头部)插入一个元素到list中 #include #i原创 2012-07-25 10:46:22 · 314 阅读 · 0 评论 -
STL学习笔记之STL介绍(下)
List 构造函数 我们已经象这样定义了list: list Fred; 你也可以象这样定义一个list,并同时初始化它的元素: // define a list of 10 elements and initialise them all to 0 list Fred(10, 0); // list now contains 0,0,0,0,0,0,0,0,0,0原创 2012-07-25 11:24:01 · 335 阅读 · 0 评论 -
STL学习笔记之六大组件
STL六大组件 容器(Container) 算法(Algorithm) 迭代器(Iterator) 仿函数(Function object) 适配器(Adaptor) 空间配置器(allocator) 1、容器 作为STL的最主要组成部分--容器,分为向量(vector),双端队列(deque),表(list),队列(queue),堆栈(stack),集合(set),多重集合(原创 2012-07-25 14:50:53 · 685 阅读 · 1 评论 -
STL学习笔记之STL介绍(中)
使用STL通用算法find()在list中查找对象 STL的通用算法find()和find_if()可以做这些。就象for_each(), count(), count_if() 一样,这些算法也使用iterator范围,这个范围指出一个list或任意其他容器中的一部分来处理。通常首iterator指着开始的位置,次iterator指着停止处理的地方。由次iterator指出的元素不被处原创 2012-07-25 11:16:00 · 395 阅读 · 0 评论