[FW]C Coding Standards Quick Reference[9]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

 

 

 

 

 

 



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
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top