[](int arg1, int arg2) -> bool { return arg1 <arg2;}
[this](int arg)
{
this->acc += arg;
}
```
```
#### b. Other code blocks ####
#### b. Other code blocks ####
@ -75,6 +85,12 @@ default:
}
}
```
```
#### d. single-line blocks (lambdas, initializer lists etc.) ####
```c++
{} // empty - space before {
{ body } // spaces around { and before }
```
### 2. If blocks ###
### 2. If blocks ###
#### a. Multiple tests ####
#### a. Multiple tests ####
```c++
```c++
@ -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.
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)
: priv_a(a)
: m_a(a)
, priv_b(b)
, m_b(b)
, priv_c(c)
, m_c(c)
, priv_d(d)
, m_d(d)
{
{
//code
//code
}
}
@ -137,7 +153,7 @@ myClass::myClass(int a, int b, int c, int d)
### 6. Enums.###
### 6. 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
{
{
Monday,
Monday,
Tuesday,
Tuesday,
@ -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.