Effective C++ item 01-04 随笔
学习是分享和合作式的! 转载请注明出处:http://blog.csdn.net/wdzxl198/article/details/9219115; 最近看《Effective C++》这本书,就做个简单的图片式的小随笔吧。推荐在线看此书的网址:http://www.kuqin.com/effectivec2e/index.html...
Effective C++ 读书笔记之Part9.Miscellany
53. Pay attention to compiler warnings. 总结: 第一,严肃对待编译器发出的警告信息。努力在你的编译器的最高(最严苛)警告级别下争取“无任何警告”的荣誉。 第二,不要过度依赖编译器的报警能力,因为不同的编译器对待事情的态度并不相同。一旦移植到另一个编译器上,你原本依赖的警告信息有可能消失。 54. Familiarize yourself with the.....
Effective C++ 读书笔记之Part8.Customizing new and delete
49. Understand the behavior of the new-handler. 总结: 第一,set_new_handler允许客户指定一个函数,在内存分配无法获得满足时被调用。 第二,Nothrow new是一个颇为局限的工具,因为它只适用于内存分配;后继的构造函数调用还是可能抛出异常。 50. Understand when it makes sense to replac.....
Effective C++ 读书笔记之Part6.Inheritance and Object-Oriented Design
32.Make sure public inheritance models "is-a". 所谓的最佳设计,取决于系统希望做什么事,包括现在与未来。 需要解决的问题:其中关于两个assert都通过的地方有些疑惑。 总结: “public继承”意味着is-a。适用于base classes身上的每一件事情一定也适用于derived classes身上,因为每一个derived class对象也都....
Effective C++ 读书笔记之Part5.Implementations
26. Postpone variable definitions as long as possible. 总结: 尽可能延后变量定义式的出现。这样做可增加程序的清晰度并改善程序效率。 批注: 纯C语言此处有冲突,C语言要求变量定义出现在代码快的开始部分。 27. Minimize casting. 1)const_cast 通常被用来将对象的常量性转除(cast awa...
Effective C++ 读书笔记之Part4.Design and Declarations
18. Make interfaces easy to use correctly and hard to use incorrrectly. 总结: 第一,好的接口很容易被正确使用,不容易被误用。你应该在你的所有接口中努力达成这些性质。 第二,“促使正确使用”的办法包括接口的一致性,以及与内置类型的行为兼容。 第三,“阻止误用”的办法包括建立新类型、限制类型上的操作,束缚对象值,以及消除客户的....
Effective C++ 读书笔记之Part3.Resource Management
13. Use objects to manage resources. 总结: 第一,为了防止资源泄露,请使用RAII对象,它们在构造函数中获得资源并在西沟函数中释放资源。 第二,两个常被使用的RAII class分别是tr1::shared_ptr和auto_ptr。前者通常是较佳选择,因为其copy行为比较直观。若选择auto_ptr,复制动作会使它(被复制物)指向null。 14.Th.....
Effective C++ 读书笔记之Part2.Constructors, Destructors, and Assignment Operators
5.Know what functions C++ silently writes and calls. 总结:编译器可以暗自为class创建default构造函数、copy构造函数、copy assginment操作符,以及析构函数。这些函数都是public的,并且是inline的。 6.Explicitly disallow the use of compiler-generated fu.....
Effective C++ 读书笔记之Part1.Accustoming Yourself to C++
1、View C++ as a federation of languages C++的四个次语言:1)C2)Object-Oriented C++3)Template C++4)STL 2、Prefer consts, enums, and inlines to #defines一方面是因为使用宏定义不利于调试的时候定位错误,另一方面主要是因为预处理器和编译器两者分工不同...
本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。
C++更多effective相关
- effective C++资源管理
- effective C++ inline
- effective C++条款
- effective C++条款语言联邦
- effective C++ operator
- effective C++ assignment
- effective C++析构函数
- effective C++笔记
- effective C++阅读笔记
- effective C++读书笔记
- effective C++ new
- 读书笔记effective C++ item异常
- more effective C++读书笔记
- 读书笔记effective C++ item虚函数
- 读书笔记effective C++ item定义
- 读书笔记effective C++ item继承而来
- effective C++ item虚函数
- 读书笔记effective C++ item行为
- 读书笔记effective C++ item资源
- 读书笔记effective C++ item谨慎
- 读书笔记effective C++ item熟悉
- 读书笔记effective C++ item接口
- 读书笔记effective C++拷贝
- 读书笔记effective C++ item new delete
- 读书笔记effective C++ item类型转换成员函数
- 读书笔记effective C++ item成员函数
- 读书笔记effective C++ item内联
开发与运维
集结各类场景实战经验,助你开发运维畅行无忧
+关注