On 3/08/2014 11:53 p.m., Bayan Rafeh wrote:
Small question. Can anyone give me an example of when one would use a
parametrized block as opposed to a parameterized class or method?

mixin templates take the context for which they are mixed in. Basically:


mixin template FooT() {
        void FooT() {
                //...
                writeln(bar);
        }
}

void myfunc() {
        string bar;
        //...
        mixin FooT;
}

Templated classes/structs/unions/method or functions are used for if you want to modify code gen itself.

Reply via email to