Mixin Template: cannot mixin scope(exit)?

Nicolas Sicard dransic at gmail.com
Tue Jan 15 03:32:09 PST 2013


On Tuesday, 15 January 2013 at 11:19:50 UTC, mist wrote:
> I thought template itself should compile but its statement-like 
> instantiation should not.

The template shouldn't compile: the D grammar says that mixin 
templates inject declarations only. Hence the text of the error.

> 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

Yes, but only a string mixin can inject a scope statement.



More information about the Digitalmars-d-learn mailing list