title: How does switch compile in Visual C++ and how optimized and fast is it?
body: <p>As I found out that I can use only numerical values in C++'s <code>switch</code> statements, I thought that there then must be some deeper difference between it and a bunch of <code>if-else</code>'s.</p>
  
  <p>Therefore I asked myself:</p>
  
  <ul>
  <li>(How) does <code>switch</code> differ from <code>if-elseif-elseif</code> in terms of runtime speed, compile time optimization and general compilation? I'm mainly speaking of MSVC here.</li>
  </ul>