mixin template

Dicebot public at dicebot.lv
Fri Jan 31 04:57:51 PST 2014


On Friday, 31 January 2014 at 06:24:27 UTC, Dan Killebrew wrote:
>> mixin template Foo(alias a){ alias Foo=a; }
>> pragma(msg, Foo!2); // error
>>
>> template Bar(alias a){ alias Bar=a; }
>> pragma(msg, Bar!2); // ok
>
> Perhaps I was unclear. What I meant:
> What does 'mixin template' do that 'template' does not?
> Where would I use 'mixin template'?

It is other way around. `mixin template` guarantees that it won't 
be used for anything else but mixing in.


More information about the Digitalmars-d-learn mailing list