[翻译] Effective C++, 3rd Edition, 附录 A. 超越 Effective C++

EffectiveC++(英文版) 经典C++书籍的英文版,浓缩了作者的真知灼见,是提高C++水平必读 立即下载

附录 A. 超越 Effective C++

作者:Scott Meyers

译者:fatalerror99 (iTePub's Nirvana)

发布:http://blog.youkuaiyun.com/fatalerror99/

Effective C++ 覆盖了我认为对当前的 C++ 程序员最重要的通用指导方针,但是如果你有兴趣在更多的方面提升你的效力,我推荐你去研读我的其他 C++ 书籍,More Effective C++ 和 Effective STL。

More Effective C++ 覆盖其它的编程指导方针,并包括像效率和带有异常编程这样的话题的广泛讨论。它也记述了像 smart pointers(智能指针),reference counting(引用计数)和 proxy objects(代理对象)这样的重要的 C++ 编程技术。

Effective STL 像 Effective C++ 一样是一本面向指导方针的书,但是它专注于标准模板库的有效使用。

下面是这两本书的目录摘要。

Contents of More Effective C++

Basics
Item 1: Distinguish between pointers and references
Item 2: Prefer C++-style casts
Item 3: Never treat arrays polymorphically
Item 4: Avoid gratuitous default constructors

Operators
Item 5: Be wary of user-defined conversion functions
Item 6: Distinguish between prefix and postfix forms of increment and decrement operators
Item 7: Never overload &&, ||, or,
Item 8: Understand the different meanings of new and delete

Exceptions
Item 9: Use destructors to prevent resource leaks
Item 10: Prevent resource leaks in constructors
Item 11: Prevent exceptions from leaving destructors
Item 12: Understand how throwing an exception differs from passing a parameter or calling a virtual function
Item 13: Catch exceptions by reference
Item 14: Use exception specifications judiciously
Item 15: Understand the costs of exception handling

Efficiency
Item 16: Remember the 80-20 rule
Item 17: Consider using lazy evaluation
Item 18: Amortize the cost of expected computations
Item 19: Understand the origin of temporary objects
Item 20: Facilitate the return value optimization
Item 21: Overload to avoid implicit type conversions
Item 22: Consider using op= instead of stand-alone op
Item 23: Consider alternative libraries
Item 24: Understand the costs of virtual functions, multiple inheritance, virtual base classes, and RTTI

Techniques
Item 25: Virtualizing constructors and non-member functions
Item 26: Limiting the number of objects of a class
Item 27: Requiring or prohibiting heap-based objects
Item 28: Smart pointers
Item 29: Reference counting
Item 30: Proxy classes
Item 31: Making functions virtual with respect to more than one object

Miscellany
Item 32: Program in the future tense
Item 33: Make non-leaf classes abstract
Item 34: Understand how to combine C++ and C in the same program
Item 35: Familiarize yourself with the language standard

Contents of Effective STL

Chapter 1: Containers
Item 1: Choose your containers with care.
Item 2: Beware the illusion of container-independent code.
Item 3: Make copying cheap and correct for objects in containers.
Item 4: Call empty instead of checking size() against zero.
Item 5: Prefer range member functions to their single-element counterparts.
Item 6: Be alert for C++'s most vexing parse.
Item 7: When using containers of newed pointers, remember to delete the pointers before the container is destroyed.
Item 8: Never create containers of auto_ptrs.
Item 9: Choose carefully among erasing options.
Item 10: Be aware of allocator conventions and restrictions.
Item 11: Understand the legitimate uses of custom allocators.
Item 12: Have realistic expectations about the thread safety of STL containers.

Chapter 2: vector and string
Item 13: Prefer vector and string to dynamically allocated arrays.
Item 14: Use reserve to avoid unnecessary reallocations.
Item 15: Be aware of variations in string implementations.
Item 16: Know how to pass vector and string data to legacy APIs.
Item 17: Use "the swap TRick" to trim excess capacity.
Item 18: Avoid using vector<bool>.

Chapter 3: Associative Containers
Item 19: Understand the difference between equality and equivalence.
Item 20: Specify comparison types for associative containers of pointers.
Item 21: Always have comparison functions return false for equal values.
Item 22: Avoid in-place key modification in set and multiset.
Item 23: Consider replacing associative containers with sorted vectors.
Item 24: Choose carefully between map::operator[] and map::insert when efficiency is important.
Item 25: Familiarize yourself with the nonstandard hashed containers.

Chapter 4: Iterators
Item 26: Prefer iterator to const_iterator, reverse_iterator, and const_reverse_iterator.
Item 27: Use distance and advance to convert a container's const_iterators to iterators.
Item 28: Understand how to use a reverse_iterator's base iterator.
Item 29: Consider istreambuf_iterators for character-by-character input.

Chapter 5: Algorithms
Item 30: Make sure destination ranges are big enough.
Item 31: Know your sorting options.
Item 32: Follow remove-like algorithms by erase if you really want to remove something.
Item 33: Be wary of remove-like algorithms on containers of pointers.
Item 34: Note which algorithms expect sorted ranges.
Item 35: Implement simple case-insensitive string comparisons via mismatch or lexicographical_compare.
Item 36: Understand the proper implementation of copy_if.
Item 37: Use accumulate or for_each to summarize ranges.

Chapter 6: Functors, Functor Classes, Functions, etc.
Item 38: Design functor classes for pass-by-value.
Item 39: Make predicates pure functions.
Item 40: Make functor classes adaptable.
Item 41: Understand the reasons for ptr_fun, mem_fun, and mem_fun_ref.
Item 42: Make sure less<T> means operator<.

Chapter 7: Programming with the STL
Item 43: Prefer algorithm calls to hand-written loops.
Item 44: Prefer member functions to algorithms with the same names.
Item 45: Distinguish among count, find, binary_search, lower_bound, upper_bound, and equal_range.
Item 46: Consider function objects instead of functions as algorithm parameters.
Item 47: Avoid producing write-only code.
Item 48: Always #include the proper headers.
Item 49: Learn to decipher STL-related compiler diagnostics.
Item 50: Familiarize yourself with STL-related web sites.

Effective C++.epub Effective C++,3rd Edition,英文版 立即下载

相关推荐

英文原版Effective C++

英文版,Effective C++,经典的C++语言解说,解压即可,不要错过~~~

[翻译] Effective C++, 3rd Edition, Item 27: 最少化 casting(强制转型)(下)

(点击此处,接上篇)在深入探究 dynamic_cast 的设计意图之前,值得留意的是多数 dynamic_cast 的实现都相当慢。例如,至少有一种通用的实现部分地基于对 class names(类名)进行 string comparisons(字符串比较)。如果你在位于一个 single-inheritance hierarchy(单继承体系)四层深处的一个 object 上执行 dyna

艺术编程 2677

Effective_C++_3rd_Edition.pdf 英文原版

Effective_C++_3rd_Edition 很棒的C++进阶书 如果能够全部都懂看完 肯定会在语言学习的基础上得到很大的提升

[翻译] Effective C++, 3rd Edition, Item 31: 最小化文件之间的 compilation dependencies(编译依赖)(上)

Item 31: 最小化文件之间的 compilation dependencies(编译依赖)作者:Scott Meyers译者:fatalerror99 (iTePubs Nirvana)发布:http://blog.csdn.net/fatalerror99/你进入到你的 C++ 程序中,并对一个 class 的 implementation(实现)进行了细微的改变。提醒你

艺术编程 4619

Effective C++第三版英文版

Effective C++第三版英文版。 内含PDF和EPUB两种格式。 有人说C++程序员可以分成两类,读过Effective C++的和没读过的。世界顶级C++大师Scott Meyers成名之作的第三版的确当得起这样的评价。当您读过这本书之后,就获得了迅速提升自己C++功力的一个契机。 在国际上﹐本书所引起的反响﹐波及整个计算技术出版领域﹐余音至今未绝。几乎在所有C++书籍的推荐名单上﹐本书都会位于前三名。作者高超的技术把握力、独特的视角﹑诙谐轻松的写作风格﹑独具匠心的内容组织﹐都受到极大的推崇和仿效。这种奇特的现象﹐只能解释为人们对这本书衷心的赞美和推崇。

Oracle GoldenGate (OGG) 实战:从安装到故障排查的完整避坑指南

本文提供了一份详尽的Oracle GoldenGate实战指南,涵盖从环境准备、核心进程配置到性能调优与故障排查的全过程。重点解析了OGG安装与部署中的常见陷阱,并分享了确保数据同步链路稳定运行的高级运维技巧与常见故障处理方法,帮助技术人员高效避坑。

weixin_29230649的博客 380

Effective系列经典著作,铺就程序员殿堂之路

Effective系列图书是我们学习中难以绕开的经典。经典书籍需要不断被重读,因为每一次重读都会带来新的体会。本文带来了5本Effective系列的经典著作,让我们一同迎着大师们的智慧之光,走向卓越。 1 《Effective C++:改善程序与设计的55个具体做法(第三版)中文版(双色)》 Effective C++: 55 Specific Ways to Improve Your Programs and Designs,3/e 【美】Scott Meyers 著 侯捷 译 有人说C++程序员可以

博文视点(北京)官方博客 1044

【技术实战】SeaTunnel 实现 HTTP 到 Doris 数据同步的配置优化与问题解决

本文分享了使用SeaTunnel实现HTTP数据源到Doris数仓同步的实战经验。详细解析了从环境搭建、核心配置到生产部署的全流程,重点针对数据类型映射、分页拉取、依赖冲突等典型问题提供了解决方案,并给出了连接参数调优、错误处理等进阶优化技巧,帮助开发者构建稳定高效的数据同步管道。

gan8painter的博客 754

[翻译] Effective C++, 3rd Edition, 附录 B. 第二和第三版之间的 Item 映射

附录 B. 第二和第三版之间的 Item 映射作者:Scott Meyers译者:fatalerror99 (iTePubs Nirvana)发布:http://blog.csdn.net/fatalerror99/Effective C++ 的第三版在很多方面与第二版不同,其中最引人注目的是它包含很多新的信息。然而,第二版的大部分内容依然保留在第三版中,虽然经常会改变形式和位置

艺术编程 5819

DSP28335量产升级避坑指南:C2Prog串口烧录.hex文件,为什么我推荐COM1?

本文详细解析了DSP28335量产升级中C2Prog串口烧录.hex文件的最佳实践,重点推荐使用COM1端口以确保稳定性。通过实测数据和底层机制分析,揭示了Windows系统对COM1的特殊优化及C2Prog工具的时钟切换逻辑,帮助开发者规避常见陷阱,提升烧录成功率。

weixin_27066963的博客 384

海康读码器上位机开发避坑指南:IDMVS客户端之外,如何用C# SDK搞定扫码、数据比对与实时控制?

本文详细介绍了如何利用海康读码器的C# SDK进行二次开发,实现从基础扫码到复杂工业控制的全流程解决方案。内容涵盖SDK架构解析、多设备管理系统构建、业务逻辑与设备控制实现,以及系统集成与性能优化等关键环节,为工业自动化领域的开发者提供实用指南。

weixin_30642561的博客 550

[翻译] Effective C++, 3rd Edition, Preface(前言)

Preface(前言)作者:Scott Meyers译者:fatalerror99 (iTePubs Nirvana)发布:http://blog.csdn.net/fatalerror99/我在 1991 年写出了 Effective C++ 的最早版本,1997 年出了第二版,我更新了一些重要的方面的素材,但是,因为我不想使熟悉本书第一版的读者感到困惑,我尽最大可能保持了原有

艺术编程 2847

ESP32-S3驱动PCA9685模块:I2C扩展16路舵机控制实战指南

本文提供了ESP32-S3通过I2C总线驱动PCA9685模块扩展16路PWM输出的完整实战指南。详细解析了PCA9685模块原理、硬件连接、I2C地址配置,并给出了核心驱动代码与角度控制函数,帮助开发者解决微控制器PWM引脚不足的问题,轻松实现多路舵机控制。

weixin_32005771的博客 523

Effective C++ 3nd 读书摘要(Third Edition 55 Specific Ways to Improve Your Programs and Design)

一、让自己习惯C++ Item1. 视C++为一个语言联邦 C++由以下部分组成:C、Object-Oriented C++、Template C++、STL Item2. 尽量以const、enum、inline代替#define Item3. 尽可能使用const 1.一共有这样几种const用法:char greeting[] = "Hello";

thy专栏 1302

Win10系统下Protel 99 SE元件库导入报错?3步搞定File is not recognized问题

本文详细介绍了在Win10系统下解决Protel 99 SE元件库导入报错'File is not recognized'的3步终极方案。通过手动修改配置文件、使用专用工具和优化系统兼容性设置,帮助用户快速解决这一经典PCB设计软件的兼容性问题,提升工作效率。

m3n5b7v8c9x的博客 797

解锁Vscode:C/C++环境配置超详细指南

本文详细介绍如何在 VSCode 中配置 C/C++ 开发环境,帮助开发者快速搭建高效的编码调试环境。内容涵盖前期准备、软件下载安装、环境变量配置、工作区文件设置及测试运行全流程:首先需准备 VSCode 编辑器、MinGW-w64 编译器及 C/C++ 插件;接着完成工具下载与安装,配置系统环境变量以确保编译器可全局调用;然后通过创建.vscode工作区文件夹,配置核心文件,实现代码智能提示与调试功能;最后通过编写 Hello World 示例验证环境可用性,并附上常见问题排查方案。

邓邓子的博客 3047

[翻译] Effective C++, 3rd Edition, Item 30: 了解 inlining(内联化)的来龙去脉(上)

Item 30: 了解 inlining(内联化)的来龙去脉作者:Scott Meyers译者:fatalerror99 (iTePubs Nirvana)发布:http://blog.csdn.net/fatalerror99/inline functions ——多么棒的主意啊!它们看起来像 functions,它们产生的效果也像 functions,它们在各方面都比 mac

艺术编程 5420

美军利用MANET技术实现无人作战单元协同作战

本文首先介绍了移动自组织网络 (MANET)以及Wave Relay®波形中继技术,并探讨了波形中继MANET平台在美空军ABMS项目等军事方面的运用情况。

guanyifu9的博客 855

Effective C++, Third Edition: 55 Specific Ways to Improve Your Programs and Designs - Cover

作者:Scott Meyers译者:fatalerror99 (iTePubs Nirvana)发布:http://blog.csdn.net/fatalerror99/

艺术编程 3256

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

《effective c++(第三版)》55个具体做法1

做法1

程序的尽头是数学,一日不推导赶不上买买提 210

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

C# 世界的《Effective C++》,来自.Net之父的核心揭秘

作为.NET程序员,如果只读三本书,那么《框架设计指南:构建可复用.NET库的约定、惯例与模式(第3版)》这本书一定不容错过!

博文视点(北京)官方博客 1137

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

[翻译] Effective C++, 3rd Edition, Item 3: 只要可能就用 const

Item 3: 只要可能就用 const作者:Scott Meyers译者:fatalerror99 (iTePubs Nirvana)发布:http://blog.csdn.net/fatalerror99/关于 const 的一件美妙的事情是它允许你指定一种 semantic(语义上的)约束:一个特定的 object(对象)不应该被修改。而 compilers(编译器)将执行

艺术编程 6679

Effective C++----3rd Edition, Item 1:将C++视为语言的联合体

Item 1: 将 C++ 视为 federation of languages(语言联合体) 作者:Scott Meyers 译者:fatalerror99 (iTePub's Nirvana) 发布:http://blog.csdn.net/fatalerror99/ 最初,C++ 仅仅是在 C 的基础上附加了一些 object-oriented(面向对象)的特性。C+

烽火前秦路 460

[翻译] Effective C++, 3rd Edition, Item 47: 为类型信息使用 traits classes(特征类)(上)

Item 47: 为类型信息使用 traits classes(特征类)作者:Scott Meyers译者:fatalerror99 (iTePubs Nirvana)发布:http://blog.csdn.net/fatalerror99/STL 主要是由 containers(容器),iterators(迭代器)和 algorithms(算法)的 templates(模板)构

艺术编程 6256
上一篇: [翻译] Effective C++, 3rd Edition, Item 48: 感受 template metaprogramming(模板元编程)
下一篇: [翻译] Effective C++, 3rd Edition, 附录 B. 第二和第三版之间的 Item 映射
fatalerror99
博客等级 码龄24年 166粉丝 20原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值