For automatically generated code of some low level kinds it is convenient to have "computed goto" like this:

https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html

and D does not have this.

A switch could be used to simulate it. But this would lead to what could have been a single jump being chained jumps.

How good is optimization in ldc2, gdc, dmd at compiling chained jumps into one jump each time?

Is there a good way to simulate computed goto in D?

Reply via email to