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