From a0bc2d71ca44c32609c72c4b584c08bc379b861a Mon Sep 17 00:00:00 2001 From: Bjarne Stroustrup Date: Mon, 3 Sep 2018 17:02:01 -0400 Subject: [PATCH] resolving #1137 clarification --- CppCoreGuidelines.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index f123d0e..bc3747c 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -10333,7 +10333,7 @@ Don't consider simple variables that are targets for input operations exceptions In the not uncommon case where the input target and the input operation get separated (as they should not) the possibility of used-before-set opens up. - int i2 = 0; // better + int i2 = 0; // better, assimin that zero is an acceptable value for i2 // ... cin >> i2; @@ -10341,8 +10341,7 @@ A good optimizer should know about input operations and eliminate the redundant ##### Example -Using an `uninitialized` or sentinel value is a symptom of a problem and not a -solution: +Using a value representing "uninitialized" is a symptom of a problem and not a solution: widget i = uninit; // bad widget j = uninit;