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

From Apache OpenOffice Wiki
Jump to: navigation, search
m
m
Line 22: Line 22:
  
 
[[/CopyAssign|Details]]
 
[[/CopyAssign|Details]]
 
----
 
 
----
 
 
----
 
 
----
 
 
----
 
 
----
 
 
----
 
 
----
 
 
----
 
 
----
 
 
----
 
 
----
 
 
----
 
  
 
----
 
----

Revision as of 16:45, 28 November 2006

Topic-Id: CLSINIT

Special issues of constructors, copying and destructors.


Summary

No Virtual Calls in Constructor or Destructor

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

Details

Constructor Initialization Section

Use the constructors initialization section to initialize your members.

Details

Obvious Copyability

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

Details

Copy and Assign Consistently

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

Details


Related Rules


Personal tools