From 6a39167b8661ab5f2dcfd0a78a4d3800785b3f58 Mon Sep 17 00:00:00 2001 From: Dima Date: Wed, 6 Jan 2016 22:31:13 -0800 Subject: [PATCH] Declaring one name per declaration. --- CppCoreGuidelines.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 2e9766c..f440203 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -7880,9 +7880,10 @@ The *always initialize* rule is a style rule aimed to improve maintainability as Here is an example that is often considered to demonstrate the need for a more relaxed rule for initialization - widget i, j; // "widget" a type that's expensive to initialize, possibly a large POD + widget i; // "widget" a type that's expensive to initialize, possibly a large POD + widget j; - if (cond) { // bad: i and j are initialized "late" + if (cond) { // bad: i and j are initialized "late" i = f1(); j = f2(); }