From 0c7a349342e73257147d578d6a4ae90652ab5cdf Mon Sep 17 00:00:00 2001 From: Neil MacIntosh Date: Mon, 13 Aug 2018 11:25:57 -0700 Subject: [PATCH] Fix example for ES.70 (#1252) 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 464f598..f76ae8c 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -12057,8 +12057,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; } }