What about an identifier that is an mixin

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 13 13:29:31 PST 2017


On Friday, 13 January 2017 at 21:15:32 UTC, André Puel wrote:
> I think this could be useful when one is creating Idiom and 
> Patterns, you could hide implementations details.

it hides the fact that mixin is used, which may be undesirable. 
otherwise, template mixins will do:

     mixin template declare_a() {
         int a; // or any code, even `mixin("int a;");`
     }

     int func() {
         mixin declare_a;
         return a;
     }


More information about the Digitalmars-d mailing list