mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
Don't reuse variable name in ES.50 example (#1348)
Reusing the name 'i' violates ES.12 and distracts from the point of the example.
This commit is contained in:
@@ -11715,9 +11715,9 @@ If the variable is actually declared `const`, the result of "casting away `const
|
|||||||
|
|
||||||
##### Example, bad
|
##### Example, bad
|
||||||
|
|
||||||
void f(const int& i)
|
void f(const int& x)
|
||||||
{
|
{
|
||||||
const_cast<int&>(i) = 42; // BAD
|
const_cast<int&>(x) = 42; // BAD
|
||||||
}
|
}
|
||||||
|
|
||||||
static int i = 0;
|
static int i = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user