title: Would an break-less switch/case be feasible?
body: <p>Would the suggestion to have a syntax for a <code>switch</code> that does not need <code>breaks</code> all the time feasible?</p>
  
  <p>My suggestion would be to insert <code>auto</code> both before <code>switch</code> and each case:</p>
  
  <pre><code>auto switch(expr) {
    auto case 1: statement; statement;
    auto case 2: statement; statement;
    default: statement; statement;
  }
  </code></pre>
  
  <p>would be equivalent to</p>
  
  <pre><code>switch(expr) {
    case 1: statement; statement; break;
    case 2: statement; statement; break;
    default: statement; statement;
  }
  </code></pre>
  
  <p>The compiler would complain with an <em>error</em></p>
  
  <ul>
  <li>if in a <code>auto switch</code> any <code>case</code> is not prepended with <code>auto</code> or</li>
  <li>if a <code>auto case</code> is used in an <code>auto</code>-less <code>switch</code>.</li>
  </ul>
  
  <p>Is there any parser problem to be expected, any ambiguities?</p>
  
  <p>Is there additional benefit from less wrong-use-errors of users, like better optimization possibilities?</p>
  
  <p><em>Update</em></p>
  
  <p>A slightly more useful case would be where the location of the break is not so clear:</p>
  
  <pre><code>case(expr) {
    case 1:
        if(isThisTrue) {
          print(that);
        } else {
          break;
        }
        doSomethingElse();
        if(!isThisTrue) {
          break;
        }
  </code></pre>
  
  <p>...or something like this.</p>
  
  <p>I think prevention of fall-through is useful to prevent some difficult to diagnose errors.</p>