Edit class open parenthensis and switch statement

master
Petr Stefan 9 years ago
parent 8116837afa
commit 86afb503b8

@ -48,11 +48,11 @@ if (x == 5) {
}
```
* For and while cycles: basically same rules as for if condition.
* Switch: again basics are the same as for if condition. Case statements should be indented with tab and case body with 2 tabs.
* Switch: again basics are the same as for if condition. Case statements should not be indented and case body should be intended with 1 tab.
```
switch (switched) {
case 0: // tab indent
... // 2 tabs indent
case 0: // no tab indent
... // 1 tab indent
break;
case 1:
...
@ -85,15 +85,14 @@ if (i > 10 &&
```
* Return values should not be generally wrapped with parentheses, only if needed.
* Preprocessor directives start with `#` and always should start at the beginning of the line.
* Classes: sections aka. public, protected, private should have same indentation as the class start itself. Opening parenthesis of class should be on the new line.
* Classes: sections aka. public, protected, private should have same indentation as the class start itself. Opening parenthesis of class should be on the same line as class name.
```
class my_class
{
class my_class {
public:
void class_function();
private:
int class_member_;
}
};
```
* Operators: around all binary operators there always should be one space.
```

Loading…
Cancel
Save