Proposed:
-----------------------
mixin template foo1 {
    const char[] foo1 = "int a;";
}
mixin char[] foo2() {
    return "int b;";
}
foo1!();
foo2();
-----------------------


Well, it's a little bit indistinctive, hard to tell if it's a normal function call or a mixin without e.g. using a mixin prefix for the function name (which is nothing better than it is now) But an advantage would be that these functions could be omitted in the final executable since they are only used at compile-time.

Reply via email to