int func(bool val) { mixin (switch4!("val", "return 1;", "return 2;", "return 3;", "return 4;")); } assert (func(true) == 3); assert (func(false) == 4); int func2(bool val)() { mixin (switch4!("val", "return 1;", "return 2;", "return 3;", "return 4;")); } assert (func2!true == 1); assert (func2!false == 2);