没有合适的资源?快使用搜索试试~ 我知道了~
Effective C++, 3rd Edition
需积分: 0 13 下载量 40 浏览量
2014-10-07
17:59:40
上传
评论
收藏 1.72MB PDF 举报
温馨提示
试读
355页
Effective C++, 3rd
资源推荐
资源详情
资源评论
Table of Contents
1Effective C++ Third Edition 55 Specific Ways to Improve Your Programs and Designs
...........
2Table of Contents
.................................................................................................................................................................................
4Copyright
.....................................................................................................................................................................................................
6Praise for Effective C++, Third Edition
...............................................................................................................................
8Addison-Wesley Professional Computing Series
......................................................................................................
10Preface
.......................................................................................................................................................................................................
11Acknowledgments
.............................................................................................................................................................................
13Introduction
.............................................................................................................................................................................................
15
Terminology
........................................................................................................................................................................................
22Chapter 1. Accustoming Yourself to C++
.......................................................................................................................
23
Item 1: View C++ as a federation of languages
.................................................................................................................
25
Item 2: Prefer consts, enums, and inlines to #defines
....................................................................................................
29
Item 3: Use const whenever possible
.....................................................................................................................................
39
Item 4: Make sure that objects are initialized before they're used
.............................................................................
46Chapter 2. Constructors, Destructors, and Assignment Operators
..........................................................
47
Item 5: Know what functions C++ silently writes and calls
............................................................................................
51
Item 6: Explicitly disallow the use of compiler-generated functions you do not want
........................................
54
Item 7: Declare destructors virtual in polymorphic base classes
................................................................................
59
Item 8: Prevent exceptions from leaving destructors
......................................................................................................
64
Item 9: Never call virtual functions during construction or destruction
....................................................................
68
Item 10: Have assignment operators return a reference to *this
................................................................................
70
Item 11: Handle assignment to self in operator=
...............................................................................................................
74
Item 12: Copy all parts of an object
.........................................................................................................................................
78Chapter 3. Resource Management
....................................................................................................................................
79
Item 13: Use objects to manage resources.
........................................................................................................................
84
Item 14: Think carefully about copying behavior in resource-managing classes.
...............................................
88
Item 15: Provide access to raw resources in resource-managing classes.
............................................................
93
Item 16: Use the same form in corresponding uses of new and delete.
.................................................................
96
Item 17: Store newed objects in smart pointers in standalone statements.
...........................................................
98Chapter 4. Designs and Declarations
..............................................................................................................................
99
Item 18: Make interfaces easy to use correctly and hard to use incorrectly
..........................................................
105
Item 19: Treat class design as type design
.......................................................................................................................
107
Item 20: Prefer pass-by-reference-to-const to pass-by-value
...................................................................................
111
Item 21: Don't try to return a reference when you must return an object
.............................................................
116
Item 22: Declare data members private
.............................................................................................................................
119
Item 23: Prefer non-member non-friend functions to member functions
.............................................................
123
Item 24: Declare non-member functions when type conversions should apply to all parameters
............
127
Item 25: Consider support for a non-throwing swap
......................................................................................................
134Chapter 5. Implementations
..................................................................................................................................................
135
Item 26: Postpone variable definitions as long as possible.
......................................................................................
139
Item 27: Minimize casting.
.......................................................................................................................................................
147
Item 28: Avoid returning 'handles' to object internals.
..................................................................................................
151
Item29: Strive for exception-safe code.
.............................................................................................................................
158
Item 30: Understand the ins and outs of inlining.
...........................................................................................................
163
Item31: Minimize compilation dependencies between files.
.....................................................................................
173Chapter 6. Inheritance and Object-Oriented Design
........................................................................................
174
Item 32: Make sure public inheritance models 'is-a.'
....................................................................................................
180
Item 33: Avoid hiding inherited names
................................................................................................................................
187
Item 34: Differentiate between inheritance of interface and inheritance of implementation
.......................
196
Item 35: Consider alternatives to virtual functions
........................................................................................................
205
Item 36: Never redefine an inherited non-virtual function
..........................................................................................
208
Item 37: Never redefine a function's inherited default parameter value
..............................................................
213
Item 38: Model 'has-a' or 'is-implemented-in-terms-of' through composition
.....................................................
216
Item 39: Use private inheritance judiciously
.....................................................................................................................
221
Item 40: Use multiple inheritance judiciously
...................................................................................................................
229Chapter 7. Templates and Generic Programming
...............................................................................................
230
Item 41: Understand implicit interfaces and compile-time polymorphism
...........................................................
234
Item 42: Understand the two meanings of typename
...................................................................................................
239
Item 43: Know how to access names in templatized base classes
........................................................................
246
Item 44: Factor parameter-independent code out of templates
...............................................................................
251
Item 45: Use member function templates to accept 'all compatible types.'
........................................................
256
Item 46: Define non-member functions inside templates when type conversions are desired
..................
261
Item 47: Use traits classes for information about types
...............................................................................................
268
Item 48: Be aware of template metaprogramming
........................................................................................................
273Chapter 8. Customizing new and delete
.....................................................................................................................
274
Item 49: Understand the behavior of the new-handler
.................................................................................................
282
Item 50: Understand when it makes sense to replace new and delete
.................................................................
285
Item 51: Adhere to convention when writing new and delete
....................................................................................
290
Item 52: Write placement delete if you write placement new
...................................................................................
297Chapter 9. Miscellany
.................................................................................................................................................................
298
Item 53: Pay attention to compiler warnings.
...................................................................................................................
300
Item 54: Familiarize yourself with the standard library, including TR1
.................................................................
304
Item.55: Familiarize yourself with Boost.
...........................................................................................................................
307Appendix A. Beyond Effective C++
..................................................................................................................................
312Appendix B. Item Mappings Between Second and Third Editions
........................................................
314Index
.........................................................................................................................................................................................................
315
index_SYMBOL
.............................................................................................................................................................................
316
index_A
.............................................................................................................................................................................................
317
index_B
.............................................................................................................................................................................................
319
index_C
.............................................................................................................................................................................................
322
index_D
.............................................................................................................................................................................................
324
index_E
.............................................................................................................................................................................................
329
index_F
.............................................................................................................................................................................................
330
index_G
............................................................................................................................................................................................
331
index_H
.............................................................................................................................................................................................
332
index_I
...............................................................................................................................................................................................
334
index_J
..............................................................................................................................................................................................
335
index_K
.............................................................................................................................................................................................
336
index_L
..............................................................................................................................................................................................
337
index_M
............................................................................................................................................................................................
339
index_N
.............................................................................................................................................................................................
340
index_O
............................................................................................................................................................................................
342
index_P
.............................................................................................................................................................................................
344
index_R
.............................................................................................................................................................................................
345
index_S
.............................................................................................................................................................................................
347
index_T
.............................................................................................................................................................................................
349
index_U
.............................................................................................................................................................................................
350
index_V
.............................................................................................................................................................................................
351
index_W
...........................................................................................................................................................................................
352
index_X
.............................................................................................................................................................................................
353
index_Z
.............................................................................................................................................................................................
< Day Day Up >
Effective C++ Third Edition 55 Specific Ways to Improve
Your Programs and Designs
By Scott Meyers
...............................................
Publisher: Addison Wesley Professional
Pub Date: May 12, 2005
Print ISBN: 0-321-33487-6
Pages: 320
Table of Contents | Index
The first two editions of Effective C++ were embraced by hundreds of
thousands of programmers worldwide. The reason is clear: Scott Meyers'
practical approach to C++ describes the rules of thumb used by the experts
—the things they almost always do or almost always avoid doing—to produce
clear, correct, efficient code.The book is organized around 55 specific
guidelines, each of which describes a way to write better C++. Each is
backed by concrete examples. For this third edition, more than half the
content is new, including added chapters on managing resources and using
templates. Topics from the second edition have been extensively revised to
reflect modern design considerations, including exceptions, design patterns,
and multithreading.Important features of Effective C++ include: Expert
guidance on the design of effective classes, functions, templates, and
inheritance hierarchies. Applications of new "TR1" standard library
functionality, along with comparisons to existing standard library components.
Insights into differences between C++ and other languages (e.g., Java, C#,
C) that help developers from those languages assimilate "the C++ way" of
doing things.
< Day Day Up >
Effective C++ Third Edition 55 Specific Ways to Improve Your Programs and Designs @Team DDUEffective C++ Third Edition 55 Specific Ways to Improve Your Programs and Designs
1 / 353
< Day Day Up >
Effective C++ Third Edition 55 Specific Ways to Improve
Your Programs and Designs
By Scott Meyers
...............................................
Publisher: Addison Wesley Professional
Pub Date: May 12, 2005
Print ISBN: 0-321-33487-6
Pages: 320
Table of Contents | Index
Copyright
Praise for Effective C++, Third Edition
Addison-Wesley Professional Computing Series
Preface
Acknowledgments
Introduction
Terminology
Chapter 1. Accustoming Yourself to C++
Item 1: View C++ as a federation of languages
Item 2: Prefer consts, enums, and inlines to #defines
Item 3: Use const whenever possible
Item 4: Make sure that objects are initialized before they're used
Chapter 2. Constructors, Destructors, and Assignment Operators
Item 5: Know what functions C++ silently writes and calls
Item 6: Explicitly disallow the use of compiler-generated functions you do not want
Item 7: Declare destructors virtual in polymorphic base classes
Item 8: Prevent exceptions from leaving destructors
Item 9: Never call virtual functions during construction or destruction
Item 10: Have assignment operators return a reference to *this
Item 11: Handle assignment to self in operator=
Item 12: Copy all parts of an object
Chapter 3. Resource Management
Item 13: Use objects to manage resources.
Item 14: Think carefully about copying behavior in resource-managing classes.
Item 15: Provide access to raw resources in resource-managing classes.
Item 16: Use the same form in corresponding uses of new and delete.
Item 17: Store newed objects in smart pointers in standalone statements.
Chapter 4. Designs and Declarations
Item 18: Make interfaces easy to use correctly and hard to use incorrectly
Item 19: Treat class design as type design
Item 20: Prefer pass-by-reference-to-const to pass-by-value
Item 21: Don't try to return a reference when you must return an object
Item 22: Declare data members private
Item 23: Prefer non-member non-friend functions to member functions
Item 24: Declare non-member functions when type conversions should apply to all parameters
Item 25: Consider support for a non-throwing swap
Chapter 5. Implementations
Item 26: Postpone variable definitions as long as possible.
Item 27: Minimize casting.
Item 28: Avoid returning "handles" to object internals.
Item29: Strive for exception-safe code.
Item 30: Understand the ins and outs of inlining.
Item31: Minimize compilation dependencies between files.
Chapter 6. Inheritance and Object-Oriented Design
Item 32: Make sure public inheritance models "is-a."
Item 33: Avoid hiding inherited names
Effective C++ Third Edition 55 Specific Ways to Improve Your Programs and Designs @Team DDUTable of Contents
2 / 353
Item 34: Differentiate between inheritance of interface and inheritance of implementation
Item 35: Consider alternatives to virtual functions
Item 36: Never redefine an inherited non-virtual function
Item 37: Never redefine a function's inherited default parameter value
Item 38: Model "has-a" or "is-implemented-in-terms-of" through composition
Item 39: Use private inheritance judiciously
Item 40: Use multiple inheritance judiciously
Chapter 7. Templates and Generic Programming
Item 41: Understand implicit interfaces and compile-time polymorphism
Item 42: Understand the two meanings of typename
Item 43: Know how to access names in templatized base classes
Item 44: Factor parameter-independent code out of templates
Item 45: Use member function templates to accept "all compatible types."
Item 46: Define non-member functions inside templates when type conversions are desired
Item 47: Use traits classes for information about types
Item 48: Be aware of template metaprogramming
Chapter 8. Customizing new and delete
Item 49: Understand the behavior of the new-handler
Item 50: Understand when it makes sense to replace new and delete
Item 51: Adhere to convention when writing new and delete
Item 52: Write placement delete if you write placement new
Chapter 9. Miscellany
Item 53: Pay attention to compiler warnings.
Item 54: Familiarize yourself with the standard library, including TR1
Item.55: Familiarize yourself with Boost.
Appendix A. Beyond Effective C++
Appendix B. Item Mappings Between Second and Third Editions
Index
< Day Day Up >
Effective C++ Third Edition 55 Specific Ways to Improve Your Programs and Designs @Team DDUTable of Contents
3 / 353
剩余354页未读,继续阅读
资源评论
WangLanguager
- 粉丝: 1w+
- 资源: 313
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2%EF%BC%9A%E9%99%95%E8%A5%BF%E
- yyspdz62_944.apk
- SAP公司间采购EDI配置-如何触发自动MIRO.docx
- python197基于图像识别的仪表实时监控系统.rar
- I2C驱动SHT30温湿度传感器和LCD12864使用例程(RSCG12864B)
- python193中学地理-中国的江河湖泊教学网(django).rar
- python191基于时间序列分析的大气污染预测软件(django).rar
- python190基于人脸识别智能化小区门禁管理系统.rar
- python189某医院体检挂号系统.rar
- python179的企业物流管理系统(django).rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功