mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fix ES.103 example
``` int area(int h, int w) { return h*w; } auto a = area(10'000'000 * 100'000'000); // bad ``` The `*` in the second line should be a comma
This commit is contained in:
parent
2d04ea8992
commit
1de6e77b15
|
@ -8451,7 +8451,7 @@ Incrementing a value beyond a maximum value can lead to memory corruption and un
|
||||||
|
|
||||||
int area(int h, int w) { return h*w; }
|
int area(int h, int w) { return h*w; }
|
||||||
|
|
||||||
auto a = area(10'000'000*100'000'000); // bad
|
auto a = area(10'000'000, 100'000'000); // bad
|
||||||
|
|
||||||
**Exception**: Use unsigned types if you really want modulo arithmetic.
|
**Exception**: Use unsigned types if you really want modulo arithmetic.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user