Switch optimization for many cases guarantees equal access time for any case? ( C++ ) -


I have seen answers for specific languages ​​here, with more than 5 cases switches, for any case time.
Is it for C / C ++? Is this specifically for GCC? For Visual Studio?
If not, then will the cases be sorted in frequency of frequency frequency support?

The standard does not guarantee how the switch statement will be implemented. I have never seen that a compiler produces a hash table, although a lot of will produce a jump table unless my memory is doing poorly than usual, both VS and GCC are sufficiently dense (For different values ​​of "enough"), then VS Unfortunately, it is not impossible to say (or even find out) when the frequency of frequency will help in sorting - this is not only different between different versions of compiler but also between compilers.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -