Addison Wesley - C++ Gotchas
Chapter 1. Basics <br> Gotcha #1: Excessive Commenting <br> Gotcha #2: Magic Numbers <br> Gotcha #3: Global Variables <br> Gotcha #4: Failure to Distinguish Overloading from Default Initialization <br> Gotcha #5: Misunderstanding References <br> Gotcha #6: Misunderstanding Const <br> Gotcha #7: Ignorance of Base Language Subtleties <br> Gotcha #8: Failure to Distinguish Access and Visibility <br> Gotcha #9: Using Bad Language <br> Gotcha #10: Ignorance of Idiom <br> Gotcha #11: Unnecessary Cleverness <br> Gotcha #12: Adolescent Behavior <br> <br> Chapter 2. Syntax <br> Gotcha #13: Array/Initializer Confusion <br> Gotcha #14: Evaluation Order Indecision <br> Gotcha #15: Precedence Problems <br> Gotcha #16: for Statement Debacle <br> Gotcha #17: Maximal Munch Problems <br> Gotcha #18: Creative Declaration-Specifier Ordering <br> Gotcha #19: Function/Object Ambiguity <br> Gotcha #20: Migrating Type-Qualifiers <br> Gotcha #21: Self-Initialization <br> Gotcha #22: Static and Extern Types <br> Gotcha #23: Operator Function Lookup Anomaly <br> Gotcha #24: Operator -> Subtleties <br> <br> Chapter 3. The Preprocessor <br> Gotcha #25: #define Literals <br> Gotcha #26: #define Pseudofunctions <br> Gotcha #27: Overuse of #if <br> Gotcha #28: Side Effects in Assertions <br> <br> Chapter 4. Conversions <br> Gotcha #29: Converting through void * <br> Gotcha #30: Slicing <br> Gotcha #31: Misunderstanding Pointer-to-Const Conversion <br> Gotcha #32: Misunderstanding Pointer-to-Pointer-to-Const Conversion <br> Gotcha #33: Misunderstanding Pointer-to-Pointer-to-Base Conversion <br> Gotcha #34: Pointer-to-Multidimensional-Array Problems <br> Gotcha #35: Unchecked Downcasting <br> Gotcha #36: Misusing Conversion Operators <br> Gotcha #37: Unintended Constructor Conversion <br> Gotcha #38: Casting under Multiple Inheritance <br> Gotcha #39: Casting Incomplete Types <br> Gotcha #40: Old-Style Casts <br> Gotcha #41: Static Casts <br> Gotcha #42: Temporary Initialization of Formal Arguments <br> Gotcha #43: Temporary Lifetime <br> Gotcha #44: References and Temporaries <br> Gotcha #45: Ambiguity Failure of dynamic_cast <br> Gotcha #46: Misunderstanding Contravariance <br> <br> Chapter 5. Initialization <br> Gotcha #47: Assignment/Initialization Confusion <br> Gotcha #48: Improperly Scoped Variables <br> Gotcha #49: Failure to Appreciate C++'s Fixation on Copy Operations <br> Gotcha #50: Bitwise Copy of Class Objects <br> Gotcha #51: Confusing Initialization and Assignment in Constructors <br> Gotcha #52: Inconsistent Ordering of the Member Initialization List <br> Gotcha #53: Virtual Base Default Initialization <br> Gotcha #54: Copy Constructor Base Initialization <br> Gotcha #55: Runtime Static Initialization Order <br> Gotcha #56: Direct versus Copy Initialization <br> Gotcha #57: Direct Argument Initialization <br> Gotcha #58: Ignorance of the Return Value Optimizations <br> Gotcha #59: Initializing a Static Member in a Constructor <br> <br> Chapter 6. Memory and Resource Management <br> Gotcha #60: Failure to Distinguish Scalar and Array Allocation <br> Gotcha #61: Checking for Allocation Failure <br> Gotcha #62: Replacing Global New and Delete <br> Gotcha #63: Confusing Scope and Activation of Member new and delete <br> Gotcha #64: Throwing String Literals <br> Gotcha #65: Improper Exception Mechanics <br> Gotcha #66: Abusing Local Addresses <br> Gotcha #67: Failure to Employ Resource Acquisition Is Initialization <br> Gotcha #68: Improper Use of auto_ptr <br> <br> Chapter 7. Polymorphism <br> Gotcha #69: Type Codes <br> Gotcha #70: Nonvirtual Base Class Destructor <br> Gotcha #71: Hiding Nonvirtual Functions <br> Gotcha #72: Making Template Methods Too Flexible <br> Gotcha #73: Overloading Virtual Functions <br> Gotcha #74: Virtual Functions with Default Argument Initializers <br> Gotcha #75: Calling Virtual Functions in Constructors and Destructors <br> Gotcha #76: Virtual Assignment <br> Gotcha #77: Failure to Distinguish among Overloading, Overriding, and Hiding <br> Gotcha #78: Failure to Grok Virtual Functions and Overriding <br> Gotcha #79: Dominance Issues <br> <br> Chapter 8. Class Design <br> Gotcha #80: Get/Set Interfaces <br> Gotcha #81: Const and Reference Data Members <br> Gotcha #82: Not Understanding the Meaning of Const Member Functions <br> Gotcha #83: Failure to Distinguish Aggregation and Acquaintance <br> Gotcha #84: Improper Operator Overloading <br> Gotcha #85: Precedence and Overloading <br> Gotcha #86: Friend versus Member Operators <br> Gotcha #87: Problems with Increment and Decrement <br> Gotcha #88: Misunderstanding Templated Copy Operations <br> <br> Chapter 9. Hierarchy Design <br> Gotcha #89: Arrays of Class Objects <br> Gotcha #90: Improper Container Substitutability <br> Gotcha #91: Failure to Understand Protected Access <br> Gotcha #92: Public Inheritance for Code Reuse <br> Gotcha #93: Concrete Public Base Classes <br> Gotcha #94: Failure to Employ Degenerate Hierarchies <br> Gotcha #95: Overuse of Inheritance <br> Gotcha #96: Type-Based Control Structures <br> Gotcha #97: Cosmic Hierarchies <br> Gotcha #98: Asking Personal Questions of an Object <br> Gotcha #99: Capability Queries <br>
- 粉丝: 1114
- 资源: 37
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助