mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
Merge pull request #1201 from mabuchner/1200-es-102-odd-loop-condition-in-second-example
Fix ES.102 odd loop condition in example
This commit is contained in:
@@ -12673,7 +12673,7 @@ This makes surprises (and bugs) inevitable.
|
||||
for (int i = 0; i < 10; ++i) a[i] = i;
|
||||
vector<int> v(10);
|
||||
// compares signed to unsigned; some compilers warn, but we should not
|
||||
for (gsl::index i = 0; v.size() < 10; ++i) v[i] = i;
|
||||
for (gsl::index i = 0; i < v.size(); ++i) v[i] = i;
|
||||
|
||||
int a2[-2]; // error: negative size
|
||||
|
||||
|
||||
Reference in New Issue
Block a user