1.1 STL概论1.1.1 STL的历史1.1.2 STL与C++标准程序库1.2 STL六大组件 功能与运用1.3 GNU源代码开放精神1.4 HP实现版本1.5 P.J.Plauger实现版本1.6 Rouge Wave实现版本1.7 STLport实现版本1.8 SGI STL实现版本1.8.1 GNU C++headers文件分布(按字母排序)1.8.2 SGI STL文件分布与简介1.8.3 SGI STL的编译器组态设置(configuration)1.9 可能令你困惑的C++ 语法1.9.1 stl_config.h中的各种组态1.9.2 临时对象的产生与运用1.9.3 静态常量整数成员在class内部直接初始化1.9.4 increment/decrement/dereference 操作符1.9.5 前闭后开区间表示法[ )1.9.6 function call操作符(operator())2.1 空间配置器的标准接口2.1.1 设计一个简单的空间配置器,JJ::allocator2.2 具备次配置力(sub-allocation)的SGI空间配置器2.2.1 SGI标准的空间配置器,std::allocator2.2.2 SGI特殊的空间配置器,std::alloc2.2.3 构造和析构基本工具:construct()和destroy()2.2.4 空间的配置与释放,std::alloc2.2.5 第一级配置器_malloc_alloc_template剖析2.2.6 第二级配置器_default_alloc_template剖析2.2.7 空间配置函数allocate()2.2.8 空间释放函数deallocate()2.2.9 重新充填free lists2.2.10 内存池(memory pool)2.3 内存基本处理工具2.3.1 uninitialized_copy2.3.2 uninitialized_fill2.3.3 uninitialized_fill_n3.1 迭代器设计思维——STL关键所在3.2 迭代器(iterator)是一种smart pointer3.3 迭代器相应型别(associated types)3.4 Traits编程技法——STL源代码门钥3.4.1 迭代器相应型别之一:value_type3.4.2 迭代器相应型别之二:difference_type3.4.3 迭代器相应型别之三:reference_type3.4.4 迭代器相应型别之四:pointer_type3.4.5 迭代器相应型别之五:iterator_category3.5 std::iterator的保证3.6 iterator源代码完整重列3.7 SGI STL的私房菜:_type_traits4.1 容器的概观与分类4.1.1 序列式容器(sequential containers)4.2 vector4.2.1 vector概述4.2.2 vector定义摘要4.2.3 vector的迭代器4.2.4 vector的数据结构4.2.5 vector的构造与内存管理:constructor,push_back4.2.6 vector的元素操作:pop_back,erase,clear,insert4.3 list4.3.1 list概述4.3.2 list的节点(node)4.3.3 list的迭代器4.3.4 list的数据结构4.3.5 list的构造与内存管理:constructor,push_back,insert4.3.6 list的元素操作:push_front,push_back,erase,pop_front,pop_back,clear,remove,unique,splice,merge,reverse,sort4.4 deque4.4.1 deque概述4.4.2 deque的中控器4.4.3 deque的迭代器4.4.4 deque的数据结构4.4.5 deque的构造与内存管理ctor,push_back,push_front4.4.6 deque的元素操作pop_back,pop_front,clear,erase,insert4.5 stack4.5.1 stack概述4.5.2 stack定义完整列表4.5.3 stack没有迭代器4.5.4 以list作为stack的底层容器4.6 queue4.6.1 queue概述4.6.2 queue定义完整列表4.6.3 queue没有迭代器4.6.4 以list作为queue的底层容器4.7 heap(隐式表述,implicit representation)4.7.1 heap概述4.7.2 heap算法push_heap算法pop_heap算法sort_heap算法make heap算法4.7.3 heap没有迭代器4.7.4 heap测试实例4.8 priority_queue4.8.1 priority_queue概述4.8.2 priority_queue定义完整列表4.8.3 priority_queue没有迭代器4.8.4 priority_queue测试实例4.9 slist 4.9.1 slist概述4.9.2 slist的节点4.9.3 slist的迭代器4.9.4 slist的数据结构4.9.5 slist的元素操作5.1 树的导览5.1.1 二叉搜索树5.1.2 平衡二叉搜索树5.1.3 AVL tree5.1.4 单旋转5.1.5 双旋转5.2 RB-tree(红黑树)5.2.1 插入节点5.2.2 一个由上而下的程序5.2.3 RB-tree的节点设计 5.2.4 RB-tree的迭代器 5.2.5 RB-tree的数据结构 5.2.6 RB-tree的构造与内存管理 5.2.7 RB-tree的元素操作 5.3 set5.4 map5.5 multiset5.6 multimap5.7 hashtable5.7.1 hashtable概述 线性探测(linear probing)二次探测(quadratic probing)开链(separate chaining)5.7.2 hashtable的桶子(buckets)与节点(nodes) 5.7.3 hashtable的迭代器 5.7.4 hashtable的数据结构 5.7.5 hashtable的构造与内存管理 插入操作(insert)与表格重整(resize)判知元素的落脚处(bkt_num)复制(copy_from)和整体删除(clear)5.7.6 hashtable运用实例 5.7.7 hash functions 5.8 hash_set5.9 hash_map5.10 hash_multiset5.11 hash_multimap6.1 算法概观6.1.1 算法分析与复杂度表示O()6.1.2 STL算法总览 6.1.3 质变算法mutating algorithms——会改变操作对象之值 6.1.4 非质变算法nonmutating algorithms——不改变操作对象之值 6.1.5 STL算法的一般形式 6.2 算法的泛化过程6.3 数值算法<stl_numeric.h>6.3.1 运用实例 6.3.2 accumulate 6.3.3 adjacent_difference 6.3.4 inner_product 6.3.5 partial_sum 6.3.6 power 6.3.7 itoa 6.4 基本算法<stl_algobase.h>6.4.1 运用实例 6.4.2 equal, fill, fill_n, iter_swap, lexicographical_compare,max,min,mismatch,swap6.4.3 copy——强化效率无所不用其极 6.4.4 copy_backward 6.5 Set相关算法6.5.1 set_union 6.5.2 set_intersection 6.5.3 set_difference 6.5.4 set_symmetric_difference 6.6 heap算法6.7 其它算法6.7.1 单纯的数据处理 6.7.2 lower_bound(应用于有序区间)6.7.3 upper_bound(应用于有序区间) 6.7.4 binary_search(应用于有序区间)6.7.5 next_permutation 6.7.6 prev_permutation 6.7.7 random_shuffle 6.7.8 partial_sort/partial_sort_copy 6.7.9 sort 6.7.10 equal_range(应用于有序区间)6.7.11 inplace_merge(应用于有序区间)6.7.12 nth_element 6.7.13 merge sort 7.1 仿函数(functor)概观4467.2 可配接(adaptable)的关键4487.2.1 unary_function 7.2.2 binary_function 7.3 算术类(Arithmetic)仿函数4517.4 关系运算类(Relational)仿函数4537.5 逻辑运算类(Logical)仿函数4557.6 证同(identity)、选择(select)、投射(project)4568.1 配接器之概观与分类8.1.1 应用于容器,container adapters 8.1.2 应用于迭代器,iterator adapters 8.1.3 应用于仿函数,functor adapters 8.2 container adapters8.2.1 stack 8.2.2 queue 8.3 iterator adapters8.3.1 insert iterators 8.3.2 reverse iterators 8.3.3 stream iterators 8.4 function adapters8.4.1 对返回值进行逻辑否定:not1,not2 8.4.2 对参数进行绑定:bindlst,bind2nd 8.4.3 用于函数合成:compose1,compose2 8.4.4 用于函数指针:ptr_fun 8.4.5 用于成员函数指针:mem_fun,mem_fun_ref附录A 参考书籍与推荐读物(Bibliography)附录B 侯捷网站(本书支持站点简介)附录C STLPort的移植经验(by 孟岩)Borland C++Builder5Microsoft Visual C++6.0索引