On Sunday, 14 July 2019 at 19:59:36 UTC, Adam D. Ruppe wrote:
but I think even attempting this is overcomplicating.
static foreach (name; FunctionNames)
{
name ~ " : " ~ name ~ "(); break;";
}
I eventually went with
`switch (mixin(index))
{
static fore
On Sunday, 14 July 2019 at 19:26:41 UTC, Sjoerd Nijboer wrote:
The code it must generate for `doSwitch!(foo, bar)()` is
`{
switch (int)
{
foo:
foo();
return;
bar:
bar();
return;
}
}`
I'd probably just do
void doSwitch
I am trying to create a template function with a switch case
inside it.
The function signature is:
`static void doSwitch(T...)(int i)`
The code it must generate for `doSwitch!(foo, bar)()` is
`{
switch (int)
{
foo:
foo();
return;
bar:
b