Hi!
Am I doing something wrong?

import std.stdio;

template gun(alias f)
{
        void gun()
        {
                f();
        }
}

void main()
{
        auto str = "hello";
        enum fun = (){writeln(str);};//replace enum -> auto to compile
        gun!fun();
}

Error:delegate c634.main.__lambda1 is a nested function and cannot be accessed from c634.gun!(delegate @system void()
{
writeln(str);
}
).gun

Reply via email to