title: What are some better ways to avoid the do-while(0); hack in C++?
body: <p>When the code flow is like this:</p>
  
  <pre><code>if(check())
  {
    ...
    ...
    if(check())
    {
      ...
      ...
      if(check())
      {
        ...
        ...
      }
    }
  }
  </code></pre>
  
  <p>I have generally seen this work around to avoid the above messy code flow:</p>
  
  <pre><code>do {
      if(!check()) break;
      ...
      ...
      if(!check()) break;
      ...
      ...
      if(!check()) break;
      ...
      ...
  } while(0);
  </code></pre>
  
  <p>What are some better ways that avoid this work-around/hack so that it becomes a higher-level (industry level) code?</p>
  
  <p>Any suggestions which are out of the box are welcome!</p>