Effective STL

Scott Meyers

出版时间

2001-06-16

ISBN

9780201749625

评分

★★★★★
书籍介绍
-
AI导读
核心看点
  • 详解STL容器选择与高效使用技巧
  • 深入剖析迭代器、算法及内存管理
  • 揭示拷贝语义与资源泄漏避免策略
适合谁读
  • 希望提升C++ STL使用水平的开发者
  • 有一定基础需查漏补缺的程序员
  • Effective系列忠实读者及C++进阶者
读前提醒
  • 内容偏旧,需结合C++11新特性阅读
  • 建议配合STL源码或标准库参考书
  • 适合案头备用,按需查阅具体条款
读者共识
  • 经典之作,虽老但核心思想仍适用
  • 部分读者认为惊喜少于Effective C++
  • 翻译版本质量参差不齐,推荐读原版

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "拷进去,拷出来。这就是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."
作者简介
-
用户评论
告诉了怎么选择容器, 高效使用操作, 放一本身边备用还是不错的.
读的好慢,惭愧。以后不要这样了。
文字比较啰嗦
相见恨晚
第一遍
2019年的最后一本technical。读了(以及在读)effective系列的其他三本 这本提供的惊喜最少。首先是内容太老 C++11及之后的STL更新对cpp编程的影响还是显著的 meyers该更新书的内容了。其次另三本effective告诉你“原来该这么做” C++STL则是“原来有这个” 各种TMP眼花缭乱。这本相对就平庸了些 也可能是我STL用的不够细致。
读之前常常自嘲自己不会cpp,只会c with STL。读完发现其实我对STL一无所知😂
虽然有点儿老了 但是依旧是好书 对我这种C++ Beginner 很有意义
好书,深入浅出,学习STL必读 查漏补缺,用STL还不熟练,加油!加油!这是一本好书,配合STL的源码一起阅读。我最近还是多看看别人写的代码,学习别人的思维模式。ps, 这本书适合对STL理解深入,《C++ Primer Plus》还是没有仔细讨论STL。pps,看的英文版本的,中文版本字都重叠起来了lol
延续了Scott Meyers的一贯的讲解思路 但是内容的实效性不够 很多functoins 比如bind1st mem_fun都已经被lambda取代 并没有延展讲解的需要
下载
收藏