mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
es.74 "loop induction variable" -> "loop variable"
This commit is contained in:
parent
fa4150b633
commit
de505d38f9
|
@ -7243,7 +7243,7 @@ Avoid using the loop variable for other purposes after the loop.
|
||||||
|
|
||||||
**Enforcement**: Warn when a variable modified inside the `for`-statement is declared outside the loop and not being used outside the loop.
|
**Enforcement**: Warn when a variable modified inside the `for`-statement is declared outside the loop and not being used outside the loop.
|
||||||
|
|
||||||
**Discussion**: Scoping the loop induction variable to the loop body also helps code optimizers greatly. Recognizing that the induction variable
|
**Discussion**: Scoping the loop variable to the loop body also helps code optimizers greatly. Recognizing that the induction variable
|
||||||
is only accessible in the loop body unblocks optimizations such as hoisting, strength reduction, loop-invariant code motion, etc.
|
is only accessible in the loop body unblocks optimizations such as hoisting, strength reduction, loop-invariant code motion, etc.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user