注册 | 登录读书好,好读书,读好书!
读书网-DuShu.com
当前位置: 首页出版图书科学技术计算机/网络软件与程序设计C/C++及其相关Effective STL

Effective STL

Effective STL

定 价:¥29.00

作 者: (美)Scott Meyers著
出版社: 中国电力出版社
丛编项: 原版风暴·深入C++系列
标 签: 暂缺

购买这本书可以去


ISBN: 9787508314976 出版时间: 2003-05-21 包装: 平装
开本: 23cm 页数: 260 字数:  

内容简介

  C++STL(Standard Template Library,标准模板库)是一次革命,但是学习如何使用它却是一个挑战。在本书中,Scott Meyers(两本最畅销的书《Effective C++》和《More Effective C++》的作者)提示了专家总结的一些关键规则,以便最大限度的使用标准模板库。其他书只是描述了STL中有什么,而本书则讲述了如何使用STL。本书共有50条原则,对于每一条原则,Scott Meyers都通过透彻的分析和经典的实例来进行讲解,从而使读者不仅可以了解要做什么,而且还能够了解何时做以及为何做。像Meyers的其他著作一样,这本书充满了从实践中总结出来的智慧。它清晰、简明、透彻的风格必将使每位STL程序员受益匪浅。

作者简介

  ScottMeyersScottMeyers:世界顶级的C++软件开发技术权威之一。他是两本畅销书EffectiveC++和MoreEffectiveC++的作者,以前曾经是C++Report的专栏作家。他经常为C/C++UsersJournal和Dr.Dobb'sJournal撰稿,也为全球范围内的客户做咨询活动。他也是AdvisoryBoardsforNumeriXLLC和InfoCruiser公司的成员。他拥有BrownUniversity的计算机科学博士学位。>>更多作品

图书目录

Preface. </font><br>Acknowledgments. </font><br>Introduction. </font><br></font><br>1. Containers. </font><br></font><br>Item 1: Choose your containers with care. </font><br>Item 2: Beware the illusion of container-independent code. </font><br>Item 3: Make copying cheap and correct for objects in containers. </font><br>Item 4: Call empty instead of checking size against zero. </font><br>Item 5: Prefer range member functions to their single-element counterparts. </font><br>Item 6: Be alert for C++'s most vexing parse. </font><br>Item 7: When using containers of newed pointers, remember to delete the pointers before the container is destroyed. </font><br>Item 8: Never create containers of auto_ptrs. </font><br>Item 9: Choose carefully among erasing options. </font><br>Item 10: Be aware of allocator conventions and restrictions. </font><br>Item 11: Understand the legitimate uses of custom allocators. </font><br>Item 12: Have realistic expectations about the thread safety of STL containers. </font><br></font><br></font><br>2. Vector and string. </font><br></font><br>Item 13: Prefer vector and string to dynamically allocated arrays. </font><br>Item 14: Use reserve to avoid unnecessary reallocations. </font><br>Item 15: Be aware of variations in string implementations. </font><br>Item 16: Know how to pass vector and string data to legacy APIs. </font><br>Item 17: Use "the swap trick" to trim excess capacity. </font><br>Item 18: Avoid using vector. </font><br></font><br></font><br>3. Associative Containers. </font><br></font><br>Item 19: Understand the difference between equality and equivalence. </font><br>Item 20: Specify comparison types for associative containers of pointers. </font><br>Item 21: Always have comparison functions return false for equal values. </font><br>Item 22: Avoid in-place key modification in set and multiset. </font><br>Item 23: Consider replacing associative containers with sorted vectors. </font><br>Item 24: Prefer map::insert to map::operator when efficiency is a concern. </font><br>Item 25: Familiarize yourself with the nonstandard hashed containers. </font><br></font><br></font><br>4. Iterators. </font><br></font><br>Item 26: Prefer iterator to const_iterator, reverse_iterator, and const_reverse_iterator. </font><br>Item 27: Use distance and advance to convert const_iterators to iterators. </font><br>Item 28: Understand how to use a reverse_iterator's base iterator. </font><br>Item 29: Consider istreambuf_iterators for character by character input. </font><br></font><br></font><br>5. Algorithms. </font><br></font><br>Item 30: Make sure destination ranges are big enough. </font><br>Item 31: Know your sorting options. </font><br>Item 32: Follow remove-like algorithms by erase if you really want to remove something. </font><br>Item 33: Be wary of remove-like algorithms on containers of pointers. </font><br>Item 34: Note which algorithms expect sorted ranges. </font><br>Item 35: Implement simple case-insensitive string comparisons via mismatch or lexicographical_compare. </font><br>Item 36: Use not1 and remove_copy_if to perform a copy_if. </font><br>Item 37: Use accumulate or for_each to summarize sequences. </font><br></font><br></font><br>6. Functors, Functor Classes, Functions, etc. </font><br></font><br>Item 38: Design functor classes for pass-by-value. </font><br>Item 39: Make predicates pure functions. </font><br>Item 40: Make functor classes adaptable. </font><br>Item 41: Understand the reasons for ptr_fun, mem_fun, and mem_fun_ref. </font><br>Item 42: Make sure less means operator<. </font><br></font><br></font><br>7. Programming with the STL. </font><br></font><br>Item 43: Prefer algorithm calls to hand-written loops. </font><br>Item 44: Prefer member functions to algorithms with the same names. </font><br>Item 45: Distinguish among count, find, binary_search, lower_bound, upper_bound, and equal_range. </font><br>Item 46: Consider function objects instead of functions as algorithm parameters. </font><br>Item 47: Avoid producing write-only code. </font><br>Item 48: Always #include the proper headers. </font><br>Item 49: Learn to decipher STL-related compiler diagnostics. </font><br>Item 50: Familiarize yourself with STL-related web sites</font><br></font><br>Bibliography</font><br></font><br>Appendix A:Locales and Case-Insensitive String Comparisons</font><br></font><br>Appendix B:Remarks on Microsoft's STL Platforms</font><br></font><br>Index

本目录推荐