aprentice, LXS: 1992 called, they want their compiler back
Modern compilers have compiled switches to jump tables wherever possible (and where it would improve performance) since many many years. Switches can be MUCH MUCH faster than a row of if/elses, and often ever so slightly faster than even function pointer arrays. I don't have MSVC right here (i'm not at my place atm), otherwise I'd show an example of what assembly it will output for some switch examples.
Modern compilers have compiled switches to jump tables wherever possible (and where it would improve performance) since many many years. Switches can be MUCH MUCH faster than a row of if/elses, and often ever so slightly faster than even function pointer arrays. I don't have MSVC right here (i'm not at my place atm), otherwise I'd show an example of what assembly it will output for some switch examples.