mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
[R.12] disambiguate identifier in examples (closes #1960)
This commit is contained in:
@@ -9518,7 +9518,7 @@ If you don't, an exception or a return might lead to a leak.
|
|||||||
|
|
||||||
##### Example, bad
|
##### Example, bad
|
||||||
|
|
||||||
void f(const string& name)
|
void func(const string& name)
|
||||||
{
|
{
|
||||||
FILE* f = fopen(name, "r"); // open the file
|
FILE* f = fopen(name, "r"); // open the file
|
||||||
vector<char> buf(1024);
|
vector<char> buf(1024);
|
||||||
@@ -9530,7 +9530,7 @@ The allocation of `buf` might fail and leak the file handle.
|
|||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
void f(const string& name)
|
void func(const string& name)
|
||||||
{
|
{
|
||||||
ifstream f{name}; // open the file
|
ifstream f{name}; // open the file
|
||||||
vector<char> buf(1024);
|
vector<char> buf(1024);
|
||||||
|
|||||||
Reference in New Issue
Block a user