More Effective C++(英文版)

More Effective C++(英文版)
作 者: 迈耶斯
出版社: 机械工业出版社
丛编项:
版权说明: 本书为出版图书,暂不支持在线阅读,请支持正版图书
标 签: C++
ISBN 出版时间 包装 开本 页数 字数
未知 暂无 暂无 未知 0 暂无

作者简介

  ScottMeyersScottMeyers:世界顶级的C++软件开发技术权威之一。他是两本畅销书EffectiveC++和MoreEffectiveC++的作者,以前曾经是C++Report的专栏作家。他经常为C/C++UsersJournal和Dr.Dobb'sJournal撰稿,也为全球范围内的客户做咨询活动。他也是AdvisoryBoardsforNumeriXLLC和InfoCruiser公司的成员。他拥有BrownUniversity的计算机科学博士学位。>>更多作品

内容简介

本书着重探讨了包括异常处理在内的一系列高级技术。其特点在于:第一,包含很多时新的标准C++的内容;第二,所讨论的主题倾向于“战略化”而非“战术化”,并且讨论得更深入、更彻底,尤其是对虚析构函数、智能指针、引用计数以及代理类等技术和模式论述的深入程度。如果说《EffectiveC++》主要讨论C++中一些相对基础的概念和技巧的话,那么《MoreEffectiveC++》则着重探讨了包括异常处理在内的一系列高级技术。与前者相比,后者具有两大主要区别:其一,它包含很多时新的标准C++的内容;第二,它讨论的主题倾向于“战略化”而非“战术化”,并且讨论得更深入、更彻底。尤其是对虚析构函数、智能指针、引用计数以及代理类(proxyclasse)等技术和模式论述的深入程度,让人很难想象是出现于这样的一本小书之中。游刃有余的技术,高超的写作技巧,Scott无疑是世界上最优秀的C++技术作家之一。在简洁、清晰、易读等方面,这两本书都卓尔不群。总之,Scott提供的这85个可以改善编程技术和设计思维的方法,都是中、高级C++程序员必备的技能。与其姊妹篇《EffectiveC++》一样,本书充满了实用性很强的忠告,对每一位以C++为开发工具的程序员而言,都是必备的读物。本书主要内容·一些经过验证的用来改善程序效率的方法,包括检验C++语言特性所带来的时间和空间上的成本。·全面地描述了C++专家所使用的高级技术,包括placementnew、virtualconstructors、smartpointers、referencecounting、proxyclasses和double-dispatching等。·以实例说明异常处理带给C++类和函数的冲击。·介绍新的语言特性,包括bool、mutable、explicit、namespaces、成员模板、标准模板库等。

图书目录

Acknowledgments

Introduction

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 constructor's.

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 I0: Prevent resource leaks in constructors.

Item I I: 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.

Recommended Reading

An auto__ptr Implementation

General Index

Index of Example Classes, Functions, and Templates