Classes 4.1 |
The public, protected, and private sections of a class shall be declared once in the order listed. |
Member functions shall not be defined within the class declaration. |
Member data in a class shall be declared private, except for static constant data. |
A member function that does not affect the state of an object is to be declared const. |
All classes shall declare a copy constructor. |
A copy constructor of a derived class shall call the copy constructor of its base class. |
A class which uses “new” to allocate instances managed by a class shall define a destructor which deallocates the memory. |
All classes which are used as base classes shall define a virtual destructor. |
The constructors of an abstract class shall be declared as protected. |
A class’ virtual functions shall not be called from within its constructors. |
An initializer shall not call member functions |
All classes shall declare an assignment operator.
本文关键:[FW]C Coding Standards Quick Reference
相关方案
|