mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +03:00
Fix #30
The loop variable should be a reference in order to effect the modification of the array elements.
This commit is contained in:
@@ -683,7 +683,7 @@ We could check earlier and improve the code:
|
||||
|
||||
void increment2(array_view<int> p)
|
||||
{
|
||||
for (int x : p) ++x;
|
||||
for (int& x : p) ++x;
|
||||
}
|
||||
|
||||
void use2(int m)
|
||||
|
||||
Reference in New Issue
Block a user