title: switch "transfer of control bypasses initialization of:" when calling a function
body: <p>I get a "transfer of control bypasses initialization of:" error when i try to build the following switch:</p>
  
  <pre><code>switch (retrycancel)
  {
      case 4:    //The user pressed RETRY
          //Enumerate all visible windows and store handle and caption in "windows"
          std::vector&lt;MainHandles::window_data&gt; windows = MainHandles().enum_windows().get_results(); 
          break;
  
      case 2: 
          //code
  }
  </code></pre>
  
  <p>It has something to do with my calling my enumerate function. If it is not allowed to call a function from within a switch, is there a workaround for this kind of problem?</p>