UTF-8 and Unix-like line ending (LF). Unless some platform specific files need other encodings/line endings.
UTF-8 and Unix-like line ending (LF). Unless some platform specific files need other encodings/line endings.
### 4. Initialization lists. ###
### 4. Initialization lists ###
Initialization lists should be vertical. This will allow for more easily readable diffs. The initialization colon should be indented and in its own line along with first argument. The rest of the arguments should be indented too and have the comma prepended.
Initialization lists should be vertical. This will allow for more easily readable diffs. The initialization colon should be indented and in its own line along with first argument. The rest of the arguments should be indented too and have the comma prepended.
```c++
```c++
myClass::myClass(int a, int b, int c, int d)
myClass::myClass(int a, int b, int c, int d)
@ -207,7 +207,7 @@ myClass::myClass(int a, int b, int c, int d)
}
}
```
```
### 5. Enums. ###
### 5. Enums ###
Enums should be vertical. This will allow for more easily readable diffs. The members should be indented.
Enums should be vertical. This will allow for more easily readable diffs. The members should be indented.
```c++
```c++
enum Days
enum Days
@ -222,7 +222,7 @@ enum Days
};
};
```
```
### 6. Names. ###
### 6. Names ###
All names should be camelCased.
All names should be camelCased.
#### a. Type names and namespaces ####
#### a. Type names and namespaces ####
@ -256,7 +256,7 @@ class MyClass
}
}
```
```
### 7. Header inclusion order. ###
### 7. Header inclusion order ###
The headers should be placed in the following group order:
The headers should be placed in the following group order:
1. Module header (in .cpp)
1. Module header (in .cpp)
2. C++ Standard Library headers
2. C++ Standard Library headers
@ -322,7 +322,7 @@ Example:
#include "ui_examplewidget.h"
#include "ui_examplewidget.h"
```
```
### 8. Include guard. ###
### 8. Include guard ###
`#pragma once` should be used instead of "include guard" in new code:
`#pragma once` should be used instead of "include guard" in new code:
```c++
```c++
// examplewidget.h
// examplewidget.h
@ -338,7 +338,7 @@ class ExampleWidget : public QWidget