mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
update at ES.72 rule
add code sample for (Prefer a `for`-statement to a `while`-statement when there is an obvious loop variable) rule
This commit is contained in:
@@ -7192,7 +7192,15 @@ This will copy each elements of `vs` into `s`. Better
|
|||||||
|
|
||||||
**Example**:
|
**Example**:
|
||||||
|
|
||||||
???
|
for (int i = 0; i < vec.size(); i++) {
|
||||||
|
// do work
|
||||||
|
}
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
while (i < vec.size()) {
|
||||||
|
// do work
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
**Enforcement**: ???
|
**Enforcement**: ???
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user