Minimum value in a range

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Aug 2 05:35:12 PDT 2011


Does anyone know why putting this alias in module scope errors out?:

import std.algorithm;

alias reduce!((a, b){ return 1; }) foo;

void main()
{
    foo([1, 2, 3]);
}

Error: delegate test.__dgliteral1!(int,int).__dgliteral1 is a nested
function and cannot
be accessed from reduce

But this will work:

import std.algorithm;

void main()
{
    alias reduce!((a, b){ return 1; }) foo;
    foo([1, 2, 3]);
}


More information about the Digitalmars-d-learn mailing list