An analog switch, but more efficient
-
As is well known when using switch (expression), thus: "The expression must be of an integral type or of a class type for which there is an unambiguous conversion to integral type". If the switch contains a number of case / 2 to 4 /, then there is no problem. Well, if you say case is 30 pieces, then dostura to 29 in a row case, the compiler must make 29 comparisons. Below is a one of the solutions to this problem. And so the program as expression must transmit the index number to any array, containing the address points transition operator goto. Everything! Notes: Of course array must contain the called function.
-
As is well known when using switch (expression), thus: "The expression must be of an integral type or of a class type for which there is an unambiguous conversion to integral type". If the switch contains a number of case / 2 to 4 /, then there is no problem. Well, if you say case is 30 pieces, then dostura to 29 in a row case, the compiler must make 29 comparisons. Below is a one of the solutions to this problem. And so the program as expression must transmit the index number to any array, containing the address points transition operator goto. Everything! Notes: Of course array must contain the called function.
Have a gander here[^]. Pay particular attention to #11.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle