Mixin Template: cannot mixin scope(exit)?

mist none at none.none
Tue Jan 15 03:19:49 PST 2013


I thought template itself should compile but its statement-like 
instantiation should not.

By the way, if all you want is to split out some generic 
statement block without using dirty string mixins, template 
functions with alias parameters may do.
I.e. http://dpaste.1azy.net/68ad8133

Don't know what about inlining for it though.

> Mixin templates are supposed to introduce *declarations* not 
> statements.
>
> Eg. even this shouldn't compile, should it?
> ---
> mixin template TimeExecution(T) if(isSomeString!T) {
>     import std.stdio;
>     writeln(T); // statement
> }
> ---



More information about the Digitalmars-d-learn mailing list