Name | Checked | Synopsis |
---|
STY#001
|
 |
The public, protected, and private sections of a class shall be declared in that order |
STY#002
|
|
Always use parentheses to clarify the order of expression evaluation |
STY#003
|
|
Use a consistent order in various kinds of class members |
STY#004
|
 |
Access static members via classes using the :: operator, instead of via objects using the . or -> operator |
STY#005
|
|
The indentation must be 4 spaces |
STY#006
|
|
In a class definition use separate public, protected, and private sections for type definitions, constants, enumerations, nested classes, friends, methods and data members |
STY#007
|
 |
Do not write multiple statements per line |
STY#008
|
 |
Always write the left parentheses directly after a method/function name |
STY#009
|
 |
Braces ("{}") which enclose a block are to be placed in the same column, on separate lines directly before and after the block |
STY#010
|
|
Use the specified method/function declaration and definition layout |
STY#011
|
 |
In declarations, attach the & or * token to the type name instead of the object name |
STY#012
|
 |
Do not use spaces around . or ->, nor between unary operators and operands |
STY#013
|
 |
Do use spaces before and after binary and ternary operators. |
STY#014
|
 |
Do not use spaces directly before and after brackets |
STY#015
|
|
Do use spaces after punctuation marks and do not use spaces before punctuation marks |
STY#016
|
|
Do not use additional parentheses in a return statement |
STY#017
|
 |
If a method/function has no formal parameter, do not use the keyword void |
STY#018
|
 |
The keyword typename shall be used to introduce a type parameter to a template |
STY#019
|
 |
Pointers to pointers should whenever possible be avoided |
STY#020
|
 |
Use std::function instead of function pointers |
STY#021
|
|
Do not mix coding styles within a group of closely related classes or within a module |
STY#022
|
 |
The names of macros are in uppercase |
STY#023
|
|
The name of a class type used for exceptions is suffixed with _EXC, Exception or Exc |
STY#024
|
 |
The name of an #include guard shall contain at least the name of the header file. |
STY#025
|
 |
Do not use letters that can be mistaken for digits, and vice versa |
STY#026
|
|
When accessing global identifiers, use :: |
STY#027
|
 |
Do not use tabs in source code |
STY#028
|
 |
The names of parameters to functions shall be specified in both the function declaration and the function definition |
STY#029
|
 |
Always provide an access specifier for class members |
STY#030
|
 |
The keyword struct shall only be used to declare a plain old data struct type |
STY#031
|
 |
Switch labels and statements should be on seperate lines |