Difference between revisions of "Cpp Coding Standards/Class Construction, Destruction and Copying"

From Apache OpenOffice Wiki
Jump to: navigation, search
Line 21: Line 21:
 
* [[../HIERARCHY#SafeCopying | HIERARCHY:SafeCopying]]
 
* [[../HIERARCHY#SafeCopying | HIERARCHY:SafeCopying]]
 
----
 
----
=== Explanations ===
+
=== Suggestions for Rules to Add or Remove ===
  
 
----
 
----
 
[[Category:Coding Standards]]
 
[[Category:Coding Standards]]

Revision as of 11:46, 28 November 2006

Class Construction, Destruction and Copying

Special issues of constructors, copying and destructors.


Summary

NoVirtualsInCtorDtor

Don't call your own class' virtual functions in a constructor or destructor.

CtorInitSection

Use the constructors initialization section to initialize your members.

ObviousCopyability

Make it obvious if the class is intended to be copied. Forbid copying otherwise.

CopyAndAssignConsistently

Declare copy and assignment operators consistently – either both, or none.


Related Rules


Suggestions for Rules to Add or Remove


Personal tools