Proposal: Dedicated-string-mixin templates/functions
Trass3r
un at known.com
Fri Feb 5 13:24:13 PST 2010
> 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.
More information about the Digitalmars-d
mailing list