From 184fe5397fff485697b22f54d51bc93635f4b993 Mon Sep 17 00:00:00 2001 From: Neil MacIntosh Date: Sun, 12 Aug 2018 21:55:30 -0700 Subject: [PATCH] Fix example for ES.70 As per #574, fixes the example in ES.70 to emphasize good use of a switch over a sequence of if-else-if statements. --- CppCoreGuidelines.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index e34aae7..6827b29 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -12051,8 +12051,15 @@ Statements control the flow of control (except for function calls and exception void use(int n) { switch (n) { // good - case 0: // ... - case 7: // ... + case 0: + // ... + break; + case 7: + // ... + break; + default: + // ... + break; } }