for (int i = 1; i <v.size();++i)//touchestwoelements:can'tbearange-for
cout <<v[i]+v[i-1]<<'\n';
for (int i = 0; i <v.size();++i)//possibleside-effect: can'tbearange-for
for (int i = 0; i <v.size();++i)//possiblesideeffect: can'tbearange-for
cout <<f(v,&v[i])<<'\n';
for (int i = 0; i <v.size();++i){//bodymesseswithloopvariable:can'tbearange-for
@ -10776,7 +10776,7 @@ Better still, if the loop variable isn't modified or copied:
##### Enforcement
Look at loops, if a traditional loop just looks at each element of a sequence, and there are no side-effects on what it does with the elements, rewrite the loop to a ranged-`for` loop.
Look at loops, if a traditional loop just looks at each element of a sequence, and there are no sideeffects on what it does with the elements, rewrite the loop to a ranged-`for` loop.
### <aname="Res-for-while"></a>ES.72: Prefer a `for`-statement to a `while`-statement when there is an obvious loop variable