当前位置:主页 > 计算机电子书 > 程序设计 > C++ pdf电子书
Effective C++:改善程序与设计的55个具体做法

Effective C++:改善程序与设计的55个具体做法 PDF 第3版

  • 更新:2020-05-09
  • 大小:16.37 MB
  • 类别:C++
  • 作者:(美)梅耶
  • 出版:电子工业出版社
  • 格式:PDF

  • 资源介绍
  • 学习心得
  • 相关内容

Effective C++:改善程序与设计的55个具体做法》是由电子工业出版社出版的一本关于C++方面的书籍,作者是(美)梅耶,主要介绍了关于Effective、C++、程序设计方面的知识内容,目前在C++类书籍综合评分为:9.9分。

书籍介绍

Effective C++》是一本轻巧短小精悍密度高的的“权威专家工作经验积累”。

假如你宣称自身是个C程序员以前,那么你一定得读过这本书。

认真地念完这本书,一般的C程序员还可以摇身一变变成大师级C程序员。

它是创作者聪慧的再一次提炼出和升化,你没有理由还要原地踏步走,赶快阅读文章这本书,奋起直追吧。

有些人说c程序员能够 分成两大类,读过effectivec的和没念过的。全球*c高手scottmeyers出道之作的第三版确实当之无愧那样的点评。当您读过这部《EffectiveC:改善程序与设计的55个具体做法》以后,就得到了快速提高自己c功底的一个突破口。

在国际性上,《Effective C++:改善程序与设计的55个具体做法》所造成的强烈反响,蔓延到全部电子信息技术的出版发行行业,余音迄今未绝。基本上在全部c书藉的强烈推荐名册上,《EffectiveC:改善程序与设计的55个具体做法》都是坐落于前三名。创作者精湛的技术性掌握力、与众不同的角度、风趣轻轻松松的写作风格、别具匠心的內容机构,都遭受巨大的青睐和效仿。这类独特的状况,只有表述为大家对这部《EffectiveC:改善程序与设计的55个具体做法》真心诚意的赞扬和青睐。

这部《Effective C++:改善程序与设计的55个具体做法》并不是念完一遍就可以置若罔闻的中式快餐读本,也不是用于处理手头难题的参考手册,只是必须您去不断阅读体会的,c是真实程序员的語言,身后拥有 精工细作的观念与无可比拟的语言表达能力,这促使它具备相近宗教信仰一样的风采。期待这部《EffectiveC:改善程序与设计的55个具体做法》可以帮您超越c的重重的艰险,领略到高空才有的壮丽风景,做一个取得成功而开心的c程序员

目录

  • 译序         vii
  • 中英简繁术语对照        ix
  • 目录         xvii
  • 序言         xxi
  • 致谢         xxiii
  • 导读         1
  • 1. 让自己习惯C         11
  • Accustoming Yourself to C 11
  • 条款01:视C 为一个语言联邦     11
  • View C as a fedueration of languages       11
  • 条款02:尽量以const, enum, inline替换 #define  13
  • Prefer consts,enums, and inlines to #defines.      13
  • 条款03:尽可能使用const         17
  • Use const whenever possible.       17
  • 条款04:确定对象被使用前已先被初始化      26
  • Make sure that objects are initialized before they're used. 26
  • 2. 构造/析构/赋值运算       34
  • Constructors, Destructors, and Assignment Operators        34
  • 条款05:了解C 默默编写并调用哪些函数         34
  • Know what functions C silently writes and calls.      34
  • 条款06:若不想使用编译器自动生成的函数,就该明确拒绝     37
  • Explicitly disallow the use of compiler-generated functions you do not want. 37
  • 条款07:为多态基类声明virtual析构函数      40
  • Declare destructors virtual in polymorphic base classes.    40
  • 条款08:别让异常逃离析构函数      44
  • Prevent exceptions from leaving destructors.      44
  • 条款09:绝不在构造和析构过程中调用virtual函数     48
  • Never call virtual functions during construction or destruction. 48
  • 条款10:令operator= 返回一个reference to *this        52
  • Have assignment operators return a reference to *this.     52
  • 条款11:在operator= 中处理「“自我赋值」”      53
  • Handle assignment to self in operator=.       53
  • 条款12:复制对象时勿忘其每一个成分 57
  • Copy all parts of an object.    57
  • 3. 资源管理   61
  • Resource Management 61
  • 条款13:以对象管理资源  61
  • Use objects to manage resources.        61
  • 条款14:在资源管理类中小心coping行为     66
  • Think carefully about copying behavior in resource-managing classes.     66
  • 条款15:在资源管理类中提供对原始资源的访问 69
  • Provide access to raw resources in resource-managing classes.        69
  • 条款16:成对使用new和delete时要采取相同形式    73
  • Use the same form in corresponding uses of new and delete.   73
  • 条款17:以独立语句将newed对象置入智能指针         75
  • Store newed objects in smart pointers in standalone statements.     75
  • 4. 设计与声明       78
  • Designs and Declarations       78
  • 条款18:让接口容易被正确使用,不易被误用     78
  • Make interfaces easy to use correctly and hard to use incorrectly.    78
  • 条款19:设计class犹如设计type    84
  • Treat class design as type design. 84
  • 条款20:宁以pass-by-reference-to-const替换pass-by-value        86
  • Prefer pass-by-reference-to-const to pass-by-value.  86
  • 条款21:必须返回对象时,别妄想返回其reference    90
  • Don't try to return a reference when you must return an object.       90
  • 条款22:将成员变量声明为private 94
  • Declare data members private.     94
  • 条款23:宁以non-member、non-friend替换member函数 98
  • Prefer non-member non-friend functions to member functions.        98
  • 条款24:若所有参数皆需类型转换,请为此采用non-member函数 102
  • Declare non-member functions when type conversions should apply to all parameters. 102
  • 条款25:考虑写出一个不抛异常的swap函数       106
  • Consider support for a non-throwing swap. 106
  • 5. 实现   113
  • Implementations    113
  • 条款26:尽可能延后变量定义式的出现时间 113
  • Postpone variable definitions as long as possible.       113
  • 条款27:尽量少做转型动作      116
  • Minimize casting.   116
  • 条款28:避免返回handles指向对象内部成分       123
  • Avoid returning "handles" to object internals.      123
  • 条款29:为“「异常安全」”而努力是值得的 127
  • Strive for exception-safe code.     127
  • 条款30:透彻了解inlining的里里外外    134
  • Understand the ins and outs of inlining.        134
  • 条款31:将文件间的编译依存关系降至最低 140
  • Minimize compilation dependencies between files.    140
  • 6. 继承与面向对象设计      149
  • Inheritance and Object-Oriented Design       149
  • 条款32:确定你的public继承塑模出is-a关系       150
  • Make sure public inheritance models "is-a." 150
  • 条款33:避免遮掩继承而来的名称  156
  • Avoid hiding inherited names.        156
  • 条款34:区分接口继承和实现继承  161
  • Differentiate between inheritance of interface and inheritance of implementation.        161
  • 条款35:考虑virtual函数以外的其它其他选择     169
  • Consider alternatives to virtual functions.    169
  • 条款36:绝不重新定义继承而来的non-virtual函数      178
  • Never redefine an inherited non-virtual function.        178
  • 条款37:绝不重新定义继承而来的缺省参数值     180
  • Never redefine a function's inherited default parameter value. 180
  • 条款38:通过复合塑模出has-a或"根据某物实现出"   184
  • Model "has-a" or "is-implemented-in-terms-of" through composition.     184
  • 条款39:明智而审慎地使用private继承         187
  • Use private inheritance judiciously.       187
  • 条款40:明智而审慎地使用多重继承      192
  • Use multiple inheritance judiciously.     192
  • 7. 模板与泛型编程       199
  • Templates and Generic Programming   199
  • 条款41:了解隐式接口和编译期多态      199
  • Understand implicit interfaces and compile-time polymorphism.       199
  • 条款42:了解typename的双重意义        203
  • Understand the two meanings of typename.       203
  • 条款43:学习处理模板化基类内的名称 207
  • Know how to access names in templatized base classes.    207
  • 条款44:将与参数无关的代码抽离templates         212
  • Factor parameter-independent code out of templates.      212
  • 条款45:运用成员函数模板接受所有兼容类型     218
  • Use member function templates to accept "all compatible types."   218
  • 条款46:需要类型转换时请为模板定义非成员函数     222
  • Define non-member functions inside templates when type conversions are desired.       222
  • 条款47:请使用traits classes表现类型信息   226
  • Use traits classes for information about types.   226
  • 条款48:认识template元编程 233
  • Be aware of template metaprogramming.   233
  • 8. 定制new和delete  239
  • Customizing new and delete 239
  • 条款49:了解new-handler的行为    240
  • Understand the behavior of the new-handler.      240
  • 条款50:了解new和delete的合理替换时机 247
  • Understand when it makes sense to replace new and delete.     247
  • 条款51:编写new和delete时需固守常规     252
  • Adhere to convention when writing new and delete.  252
  • 条款52:写了placement new也要写placement delete 256
  • Write placement delete if you write placement new.  256
  • 9. 杂项讨论   262
  • Miscellany       262
  • 条款53:不要轻忽编译器的警告      262
  • Pay attention to compiler warnings.     262
  • 条款54:让自己熟悉包括TR1在内的标准程序库 263
  • Familiarize yourself with the standard library, including TR1.      263
  • 条款55:让自己熟悉Boost        269
  • Familiarize yourself with Boost.    269
  • A 本书之外    273
  • B 新旧版条款对映        277
  • 索引         280

资源获取

资源地址1:https://pan.baidu.com/s/1YabQxvt3cSDoKHaQ90_4oA(密码:jwm8)

相关资源

网友留言