Merge pull request #1201 from mabuchner/1200-es-102-odd-loop-condition-in-second-example

Fix ES.102 odd loop condition in example
pull/1208/head
Gabriel Dos Reis 8 years ago committed by GitHub
commit 046b2a0833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save