From Apache OpenOffice Wiki
|
|
(13 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | == Class Construction, Destruction and Copying ==
| + | #REDIRECT [[Cpp_Coding_Standards/CLSINIT]] |
− | 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 ===
| + | |
− | * [[../CLSDESIGN#NoImplicitConversions | CLSDESIGN:NoImplicitConversions]]
| + | |
− | * [[../ERR#NeverFails | ERR:NeverFails]]
| + | |
− | * [[../HIERARCHY#RightDestructor | HIERARCHY:RightDestructor]]
| + | |
− | * [[../HIERARCHY#SafeCopying | HIERARCHY:SafeCopying]]
| + | |
− | ----
| + | |
− | === Explanations ===
| + | |
− | | + | |
− | ----
| + | |
− | [[Category:Coding Standards]]
| + | |
Latest revision as of 10:44, 13 April 2007