mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Merge pull request #406 from Alexolut/patch-3
added spaces around operators.
This commit is contained in:
commit
b873f02285
|
@ -8551,9 +8551,9 @@ A programmer should know and use the basic rules for expressions.
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
x=k * y + z; // OK
|
x = k * y + z; // OK
|
||||||
|
|
||||||
auto t1 = k*y; // bad: unnecessarily verbose
|
auto t1 = k * y; // bad: unnecessarily verbose
|
||||||
x = t1 + z;
|
x = t1 + z;
|
||||||
|
|
||||||
if (0 <= x && x < max) // OK
|
if (0 <= x && x < max) // OK
|
||||||
|
@ -8595,7 +8595,7 @@ Note: We recommend that programmers know their precedence table for the arithmet
|
||||||
|
|
||||||
You should know enough not to need parentheses for:
|
You should know enough not to need parentheses for:
|
||||||
|
|
||||||
if (a<0 || a<=max) {
|
if (a < 0 || a <= max) {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user