Add a note about switch

Wed, 04 Oct 2017 10:13:39 +0200

author
David Demelier <markand@malikania.fr>
date
Wed, 04 Oct 2017 10:13:39 +0200
changeset 16
780c138ab41d
parent 15
90a1769a651a
child 17
314e8bb2659a

Add a note about switch

STYLE_CPP.md file | annotate | diff | comparison | revisions
--- a/STYLE_CPP.md	Fri Sep 22 09:27:33 2017 +0200
+++ b/STYLE_CPP.md	Wed Oct 04 10:13:39 2017 +0200
@@ -120,6 +120,19 @@
         green
     };
 
+### Switch
+
+In a switch case statement, you **must** not declare variables and not indent
+cases.
+
+    switch (variable) {
+    case foo:
+        do_some_stuff();
+        break;
+    default:
+        break;
+    }
+
 ### Files
 
   - Use `.cpp` and `.hpp` as file extensions,

mercurial