Effective C ++

xiaoxiao2021-03-06  43

Terms 1: Try to use const and inline without #define clause 2: Try to use without Terms 3: Try to use New and Delete without Malloc and Free Terms 4: Try to use C -style annotation terms 5: The corresponding new and delete should be used in the same form of clause 6: The destructor calls DELETE Terms 7: Prepare the memory insufficient memory 8: Write Operator New and Operator Delete to follow the General Terms 9: Avoid hidden standard forms of New Terms 10: If you write Operator New, you should write the Operator Delete Terms at the same time: To dynamically allocate a class declaration of a copy constructor and an assignment operator Terfer 12: Try to use initialization instead of constructing Function Terms 13: Initializing the order in the list, the order of the members listed in the list, the same clauses in the order declared in the class 14: Determine the base class has a false array function Terms 15: Let Operator = Return * THIS Terms 16: In Operator = In all data members Assignment Terms 17: Check the Situation Terms for You Assignments in Operator = 18: Strive to make the class's interface complete and minimum clause 19: Distinguishing member functions, non-member functions and friend function clause 20: Avoid public Interface Data Metrical Terms 21: Use Const Terms as much as possible 22: Try to use "Biographical reference" without "piped" clause 23: Do not try to return a reference clause 24 when returning to an object 24: Overload and setting parameters Default, cautious selection clause 25: Avoiding the Terms of Types and Digital Types 26: Beware of Potential Embodiment 27: If you don't want to use implicitly generated functions, it is necessary to explicitly prohibit it. 28: Division of the whole bureau Space Terms 29: Avoid returning to internal data Handle Terms: Avoiding such a member function: The return value is a non-Const pointer or reference to the member, but the member's access level is lower than this function 31: Do not return local The reference to the object, not to return the reference clause of the pointer initialized inside the function 32: Delay the variables of the definition clause 33: Into the Inline Terms 34: Terms of Compilation Dependence between the Documents 35: Make public inheritance "Is a" meaning "is a" one "means 36: Differentiate interface inheritance and implementation of inheritance Terms 37: Do not redefine the inherited non-virtual function clause 38: Never redefine the default parameter terms of the inheritance 39 : Avoid "down-to-conversion" inheritance hierarchical clause 40: "One" or " ... to achieve the Terms 41: Distinguishing Inheritance and Template Terms 42: Smart Using Private Inheritance Terms 43: Smart Terms of Inheritance Terms 44: Say what you want to say; understand what you said 45: Character C Behind the scenes, the function clause 46: I would rather compilation and link, do not run the error Terms 47: Ensure that the non-local static object is initialized before use 48: Pay attention to the compiler warning Terms 49: Familiar standard Terms of Library 50: Improvement to C

转载请注明原文地址:https://www.9cbs.com/read-69750.html

New Post(0)