How Nested Functions Work, part 2

Max Samukha spambox at d-coding.com
Sat Sep 19 02:46:03 PDT 2009


Walter Bright wrote:

> 
http://www.reddit.com/r/programming/comments/9lxy5/how_nested_functions_clos


There is a typo in the example (if it is supposed to be compiled with 
current dmd):

int bar(int i)
{
    int abc(int x) { return i + x; }

    return foo(&abc);
}

should be

int bar(int i)
{
    int abc(int x) { return i + x; }

    return foo!abc;
}











More information about the Digitalmars-d mailing list