Effective STL(中文版)
Book information
Description
50条有效使用STL的经验 关于本电子书......Page 244 前言......Page 1 致谢......Page 3 导读......Page 6 容器......Page 13 条款1:仔细选择你的容器......Page 14 条款2:小心对“容器无关代码”的幻想......Page 17 条款3:使容器里对象的拷贝操作轻量而正确......Page 21 条款4:用empty来代替检查size()是否为0......Page 24 条款5:尽量使用区间成员函数代替它们的单元素兄弟......Page 26 条款6:警惕C++最令人恼怒的解析......Page 33 条款7:当使用new得指针的容器时,记得在销毁容器前delete那些指针......Page 36 条款8:永不建立auto_ptr的容器......Page 41 条款9:在删除选项中仔细选择......Page 44 条款10:注意分配器的协定和约束......Page 50 条款11:理解自定义分配器的正确用法......Page 55 条款12:对STL容器线程安全性的期待现实一些......Page 59 vector和string......Page 63 条款13:尽量使用vector和string来代替动态分配的数组......Page 64 条款14:使用reserve来避免不必要的重新分配......Page 66 条款15:小心string实现的多样性......Page 69 条款16: 如何将vector和string的数据传给遗留的API......Page 73 条款17:使用“交换技巧”来修整过剩容量......Page 77 条款18:避免使用vector......Page 79 关联容器......Page 82 条款19:了解相等和等价的区别......Page 83 条款20:为指针的关联容器指定比较类型......Page 87 条款21: 永远让比较函数对相等的值返回false......Page 92 条款22:避免原地修改set和multiset的键......Page 95 条款23:考虑用有序vector代替关联容器......Page 101 条款24:当关乎效率时应该在map::operator[]和map-insert之间仔细选择......Page 106 条款25:熟悉非标准散列容器......Page 112 迭代器......Page 116 条款26:尽量用iterator代替const_iterator,reverse_iterator和const_reverse_iterator......Page 117 条款27:用distance和advance把const_iterator转化成iterator......Page 121 条款28:了解如何通过reverse_iterator的base得到iterator......Page 125 条款29:需要一个一个字符输入时考虑使用istreambuf_iterator......Page 128 算法......Page 130 条款30:确保目标区间足够大......Page 131 条款31:了解你的排序选择......Page 136 条款32:如果你真的想删除东西的话就在类似remove的算法后接上erase......Page 141 条款33:提防在指针的容器上使用类似remove的算法......Page 146 条款34:注意哪个算法需要有序区间......Page 150 条款35:通过mismatch或lexicographical比较实现简单的忽略大小写字符串比较......Page 153 条款36:了解copy_if的正确实现......Page 157 条款37:用accumulate或for_each来统计区间......Page 160 仿函数、仿函数类、函数等......Page 165 条款38:把仿函数类设计为用于值传递......Page 166 条款39:用纯函数做判断式......Page 170 条款40:使仿函数类可适配......Page 173 条款41:了解使用ptr_fun、mem_fun和mem_fun_ref的原因......Page 177 条款42:确定less表示operator
Similar books
Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library
2001 · PDF
Overview of the New C++ (C++0x)
Effective C++: 55 Specific Ways to Improve Your Programs and Designs
2005 · PDF
Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14
2014 · PDF
Effective C++: 55 Specific Ways to Improve Your Programs and Designs
2005 · PDF
Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14
2014 · PDF
Effective C++ in an Embedded Environment
2012 · PDF
Effective Modern C++
2022 · EPUB