Hi!Today I completly understood,what I don't now what is the difference between template and mixin template,becouse I think that this should'nt work.But compiler is disagree.Could anybody explain me please?

import std.stdio;

int x;
template smth()
{
        void smth(){x = 1;}
}

void main()
{
        int x;
        mixin smth;//why it compiles? smth is a regular template
        smth();
        writeln(.x);
        writeln(x);
        readln();
}

Reply via email to