On 2012-05-16 23:19, John Maschmeyer wrote:
It works for a function literal that has been assigned to a variable.Function Literal: int function(int) func = x => x+1; writeln(__traits(codeof, func)); Outputs: int function(int) func = delegate pure nothrow @safe int(int x) { return x + 1; } ;
Does it work if the lambda is passed to a function:
void foo (int delegate (int x) dg)
{
wirteln(__traits(codeof, dg);
}
foo(x => x + 1);
--
/Jacob Carlborg
