|
|
|
@ -231,8 +231,8 @@ Example:
@@ -231,8 +231,8 @@ Example:
|
|
|
|
|
|
|
|
|
|
#include <libtorrent/version.hpp> |
|
|
|
|
|
|
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
|
#include "base/bittorrent/infohash.h" |
|
|
|
|
#include "base/bittorrent/session.h" |
|
|
|
|
#include "base/utils/fs.h" |
|
|
|
|
#include "base/utils/misc.h" |
|
|
|
|
#include "base/utils/string.h" |
|
|
|
@ -282,20 +282,32 @@ auto spinBox = static_cast<QSpinBox*>(sender());
@@ -282,20 +282,32 @@ auto spinBox = static_cast<QSpinBox*>(sender());
|
|
|
|
|
// we know the variable type based on the right-hand expression |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
* Space around operations eg `a = b + c` or `a=b+c`: |
|
|
|
|
|
|
|
|
|
Before and after the assignment and other binary (and ternary) operators there should be a space.<br/> |
|
|
|
|
There should not be a space between increment/decrement and its operand.<br/> |
|
|
|
|
Some valid use cases: |
|
|
|
|
* Notice the spaces in the following specific situations: |
|
|
|
|
```c++ |
|
|
|
|
// Before and after the assignment and other binary (and ternary) operators there should be a space |
|
|
|
|
// There should not be a space between increment/decrement and its operand |
|
|
|
|
a += 20; |
|
|
|
|
a = (b <= MAX_B ? b : MAX_B); |
|
|
|
|
++a; |
|
|
|
|
b--; |
|
|
|
|
--b; |
|
|
|
|
|
|
|
|
|
for (int a = 0; a < b; ++b) { |
|
|
|
|
// code |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Range-based for loop, spaces before and after the colon |
|
|
|
|
for (auto i : container) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Derived class, spaces before and after the colon |
|
|
|
|
class Derived : public Base |
|
|
|
|
{ |
|
|
|
|
}; |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
* Prefer pre-increment, pre-decrement operators |
|
|
|
|
```c++ |
|
|
|
|
++i, --j; // Yes |
|
|
|
|
i++, j--; // No |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
* private/public/protected must not be indented |
|
|
|
|