From dfaecb2e75c9060a7fb33cbbdeb67bd14476ad56 Mon Sep 17 00:00:00 2001 From: Sergey Zubkov Date: Thu, 22 Sep 2022 23:42:40 -0400 Subject: [PATCH] [R.12] disambiguate identifier in examples (closes #1960) --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 0fe57f4..9e553b7 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -9518,7 +9518,7 @@ If you don't, an exception or a return might lead to a leak. ##### Example, bad - void f(const string& name) + void func(const string& name) { FILE* f = fopen(name, "r"); // open the file vector buf(1024); @@ -9530,7 +9530,7 @@ The allocation of `buf` might fail and leak the file handle. ##### Example - void f(const string& name) + void func(const string& name) { ifstream f{name}; // open the file vector buf(1024);