Effective STL

[美] Scott Meyers

出版时间

2013-04-30

ISBN

9787121201257

评分

★★★★★
书籍介绍
这本书的真正价值,不在于告诉你STL有哪些容器,而在于揭示C++标准模板库背后那个
作者简介
Scott Meyers,世界顶级C++软件开发技术权威之一。他是两本畅销书Effective C++和More Effective C++的作者,以前曾经是C++ Report的专栏作家。他经常为C/C++ Users Journal和Dr. Dobb's Journal撰稿,也为全球范围内的客户做咨询活动。他也是Advisory Boards for NumeriX LLC和InfoCruiser公司的成员。他拥有Brown University的计算机科学博士学位。 潘爱民,任职于阿里云计算有限公司,担任阿里云OS首席架构师。长期从事软件和系统技术的研究与开发工作,撰写了大量软件技术文章,著译了多部经典计算机图书,在国内外学术刊物上发表了30多篇文章。曾经任教于北京大学和清华大学(兼职)。后进入工业界,先后任职于微软亚洲研究院、盛大网络发展有限公司和阿里云计算有限公司。目前也是工信部移动操作系统专家组成员。 潘爱民获得了数学学士学位和计算机科学博士学位,主要研究领域包括软件设计、信息安全、操作系统和互联网技术。
AI导读
核心看点
  • 50条原则指导高效使用STL
  • 揭示专家常用与避免的做法
  • 透彻分析配合深刻实例讲解
读者共识
  • Effective系列经典著作之一
  • 内容虽老但核心思想仍佳
  • 翻译质量与排版略有瑕疵
精彩摘录
  • "拷进去,拷出来。这就是STL的方式。... ,拷贝对象是STL的方式。"
  • "To avoid resource leaks when you have containers of pointers that should be deleted, you must either replace the pointers with smart reference-counting pointer objects (such as Boost's shared_ptr) or you must manually delete each pointer in the container before the container is destroyed."
  • "1.the erase-remove idiom is the best way to get rid of elements with a specific value when c is a vector, string, or deque."
  • "2.the remove member function is the best way to get rid of elements with a specific value when c is a list."
  • "*To eliminate all objects in a container that have a particular value: If the container is a vector, string, or deque, use the erase-remove idiom. If the container is a list, use list::remove. If the container is a standard associative container, use its erase member function. *To eliminate all obje"
  • "The expression vector<Contestant>(contestants) creates a temporary vector that is a copy of contestants: vector's copy constructor does the work. However, vector's copy constructor allocates only as much memory as is needed for the elements being copied, so this temporary vector has no excess capaci"
  • "That's why it makes sense to consider using a sorted vector instead of an associative container only when you know that your data structure is used in such a way that lookups are almost never mixed with insertions and erasures."
  • "If you're updating an existing map element, operator[] is preferable, but if you're adding a new element, insert has the edge."
目录
引言...............................................................................................................1
1 容器..........................................................................................9
第1 条:慎重选择容器类型。............................................................... 9
第2 条:不要试图编写独立于容器类型的代码。.................................... 12
第3 条:确保容器中的对象拷贝正确而高效。....................................... 16

显示全部
用户评论
书本身不错,译者也很专业,但是,我还是灰常BS这种翻译版和原版对不上页码的情况,对errata简直就是自寻死路。。。
关于STL一个比较好的介绍,尽管有些内容已经过时,但是好歹算是知道一些STL常见的坑和最佳实践。
补标。似乎是绝版了,是在淘宝上买了个打印版。 读完后才发现绝版是有原因的,很多内容都已经过时了。
粗略看了一遍,不是书不好,是我太菜了………………
C++开发必读经典。
书是好书,只是不少内容在今天已经陈旧了
老书了,拾遗补漏
第6章过时了
这本书比较容易读,难度较小。其中讲了一些 STL 中的技巧和坑点,值得一看。
下载
收藏