title: How to break out of a loop from inside a switch?
body: <p>I'm writing some code that looks like this:</p>
  
  <pre><code>while(true) {
      switch(msg-&gt;state) {
      case MSGTYPE: // ... 
          break;
      // ... more stuff ...
      case DONE:
          break; // **HERE, I want to break out of the loop itself**
      }
  }
  </code></pre>
  
  <p>Is there any direct way to do that?</p>
  
  <p>I know I can use a flag, and break from the loop by putting a conditional break just after the switch. I just want to know if C++ has some construct for this already.</p>