目录
1 介绍..................................................................................................................................................3
1.1 动机.......................................................................................................................................3
1.2 STL 历史...............................................................................................................................3
1.3 STL 和 ANSI/ISO C++草案标准.........................................................................................3
1.4 内容安排...............................................................................................................................3
2 C++基础...........................................................................................................................................4
2.1 类...........................................................................................................................................4
2.2 函数对象(Function Objects).................................................................................................5
2.3 模板(Template).....................................................................................................................6
2.3.1 函数模板....................................................................................................................6
2.3.2 类模板........................................................................................................................7
2.3.3 模板特化....................................................................................................................7
3 STL 概貌..........................................................................................................................................8
3.1 STL 网上信息.......................................................................................................................8
3.2 STL 文档...............................................................................................................................9
3.3 编译 STL 程序......................................................................................................................9
4 学习 STL........................................................................................................................................10
4.1 容器(Container)..................................................................................................................10
4.1.1 向量(Vector).............................................................................................................10
4.2 迭代器(Iterator)..................................................................................................................13
4.2.1 输入和输出迭代器..................................................................................................13
4.2.2 向前迭代器..............................................................................................................14
4.2.3 双向迭代器..............................................................................................................14
4.2.4 任意存取迭代器......................................................................................................15
4.3 算法和函数对象.................................................................................................................16
4.3.1 如何创建基本算法..................................................................................................16
4.3.2 STL 算法..................................................................................................................18
4.4 适应器(Adaptor).................................................................................................................20
4.4.1 容器适应器..............................................................................................................20
4.4.2 迭代适应器..............................................................................................................21
4.4.3 函数适应器..............................................................................................................21
4.5 分配算符和内存处理.........................................................................................................22
5 其余的 STL 部件...........................................................................................................................22
5.1 各部件如何协同工作.........................................................................................................22
5.2 向量(Vector)........................................................................................................................23
5.3 线性表(List)........................................................................................................................23
5.4 双向队列(Deque)................................................................................................................23
5.5 迭代标签(Iterator Tag).......................................................................................................23
5.6 关联容器(Container)..........................................................................................................23
6 版权信息........................................................................................................................................25
7 文献................................................................................................................................................26
8 后话................................................................................................................................................27