Cpp Coding Standards/FDESIGN
From Apache OpenOffice Wiki
< Cpp Coding Standards(Redirected from Cpp Coding Standards/Topics/FDESIGN)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Function Design (FDESIGN)
Design of functions and function prototypes.
Items referring to code in function bodies, reside in topic FIMPL - Function Implementation.
One Task (OneTask)
Give a function only one cohesive task. -> Details
Canonical Operators (CanOp)
Use canonical signatures for all operator overloads. Provide canonical behavior for arithmetic operators. -> Details
Unambiguous Parameters (Params)
Mark parameter intention unambiguously. Out- and inout- parameters need to be distinguished unmistakably.
Use smart pointers as parameter type for objects on the heap, when the responsibility for deleting is unclear or transfered between caller and callee. -> Details
Related Rules
Short Functions -> FIMPL:Short
Consistency -> IFC:Consi
Unambiguous Overloads ->IFC:Over