最新更新
- Borland c++宝典
- 实用C++编程大全(Practical C++ Progranmming)
- Visual C/C++编程精选集锦-数据库及图形图像分册
- C和C++实务精选 C和指针 (PDG)
- c++ neural networks and fuzzy logic
- C++ Effective STL
- C++ GUI Programming with Qt 4, Second Edition
- Visual C/C++编程精选集锦-关键技术精解分册
- C/C++指针经验总结
- C/C++与数据结构
- 面向对象程序设计与C++教程
- C++程序设计语言特别版(中文版+英文原版)
- Visual C++程序员实用大全(精华版)源代码
- Visual C++案例开发-源代码
- Visual C++.NET专业项目实例开发-源代码
下载排行
百度搜索
C++ Effective STL
-
软件简介:
- 上论坛找商业破解网站程序
- 源码使用如需帮助,请到论坛发帖!
Content
Containers...................................................................................................................1
Item 1. Choose your containers with care...........................................................1
Item 2. Beware the illusion of container-independent code................................4
Item 3. Make copying cheap and correct for objects in containers.....................9
Item 4. Call empty instead of checking size() against zero..............................11
Item 5. Prefer range member functions to their single-element counterparts...12
Item 6. Be alert for C++'s most vexing parse...................................................20
Item 7. When using containers of newed pointers, remember to delete the pointers before the container is destroyed............................................................22
Item 8. Never create containers of auto_ptrs....................................................27
Item 9. Choose carefully among erasing options..............................................29
Item 10. Be aware of allocator conventions and restrictions..........................34
Item 11. Understand the legitimate uses of custom allocators........................40
Item 12. Have realistic expectations about the thread safety of STL containers. 43
vector and string........................................................................................................48
Item 13. Prefer vector and string to dynamically allocated arrays..................48
Item 14. Use reserve to avoid unnecessary reallocations................................50
Item 15. Be aware of variations in string implementations............................52
Item 16. Know how to pass vector and string data to legacy APIs................57
Item 17. Use "the swap trick" to trim excess capacity....................................60
Item 18. Avoid using vector<bool>................................................................62
Associative Containers..............................................................................................65
Item 19. Understand the difference between equality and equivalence..........65 i
Item 20. Specify comparison types for associative containers of pointers.....69
Item 21. Always have comparison functions return false for equal values....73
Item 22. Avoid in-place key modification in set and multiset........................76
Item 23. Consider replacing associative containers with sorted vectors........81
Item 24. Choose carefully between map::operator[] and map-insert when efficiency is important..........................................................................................87
Item 25. Familiarize yourself with the nonstandard hashed containers..........91
Iterators.....................................................................................................................95
Item 26. Prefer iterator to const iterator, reverse_iterator, and const_reverse_iterator...........................................................................................95
Item 27. Use distance and advance to convert a container's const_iterators to iterators. 98
Item 28. Understand how to use a reverse_iterator's base iterator................101
Item 29. Consider istreambuf_iterators for character-by-character input.....103
Algorithms..............................................................................................................106
Item 30. Make sure destination ranges are big enough.................................106
Item 31. Know your sorting options.............................................................111
Item 32. Follow remove-like algorithms by erase if you really want to remove something. 116
Item 33. Be wary of remove-like algorithms on containers of pointers.......120
Item 34. Note which algorithms expect sorted ranges..................................123
Item 35. Implement simple case-insensitive string comparisons via mismatch or lexicographical compare.................................................................................126
Item 36. Understand the proper implementation of copy_if.........................130
Item 37. Use accumulate or for_each to summarize ranges.........................132
Functors, Functor Classes, Functions, etc...............................................................138
Item 38. Design functor classes for pass-by-value.......................................138
Item 39. Make predicates pure functions......................................................141 ii
Item 40. Make functor classes adaptable......................................................144
Item 41. Understand the reasons for ptr_fun, mem_fun, and mem_fun_ref.148
Item 42. Make sure less<T> means operator<..............................................151
Programming with the STL....................................................................................155
Item 43. Prefer algorithm calls to hand-written loops..................................155
Item 44. Prefer member functions to algorithms with the same names........162
Item 45. Distinguish among count, find, binary search, lower_bound, upper_bound, and equal_range...........................................................................165
Item 46. Consider function objects instead of functions as algorithm parameters. 173
Item 47. Avoid producing write-only code...................................................177
Item 48. Always #include the proper headers...............................................179
Item 49. Learn to decipher STL-related compiler diagnostics......................181
Item 50. Familiarize yourself with STL-related web sites............................187
投一票:




添加到百度搜藏





