#### d. single-line blocks (lambdas, initializer lists etc.) ####
```c++
{} // empty - space before {
{ body } // spaces around { and before }
```
### 2. If blocks ###
#### a. Multiple tests ####
```c++
@ -125,10 +141,10 @@ UTF-8 and Unix-like line ending (LF). Unless some platform specific files need o
@@ -125,10 +141,10 @@ UTF-8 and Unix-like line ending (LF). Unless some platform specific files need o
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++
myClass::myClass(int a, int b, int c, int d)
: priv_a(a)
, priv_b(b)
, priv_c(c)
, priv_d(d)
: m_a(a)
, m_b(b)
, m_c(c)
, m_d(d)
{
//code
}
@ -137,7 +153,7 @@ myClass::myClass(int a, int b, int c, int d)
@@ -137,7 +153,7 @@ myClass::myClass(int a, int b, int c, int d)
### 6. Enums.###
Enums should be vertical. This will allow for more easily readable diffs. The members should be indented.
```c++
enum days
enum Days
{
Monday,
Tuesday,
@ -149,7 +165,41 @@ enum days
@@ -149,7 +165,41 @@ enum days
};
```
### 7. Misc.###
### 7. Names.###
All names should be camelCased.
#### a. Type names and namespaces ####
Type names and namespaces start with Upper case letter (except POD types).
```c++
class ClassName {}
struct StructName {}
enum EnumName {}
typedef QList<ClassName> SomeList;
namespace NamespaceName
{
}
```
#### b. Variable names ####
Variable names start with lower case letter.
```c++
int myVar;
```
#### c. Private member variable names ####
Private member variable names start with lower case letter and should have ```m_``` prefix.