Reduce help..

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Sep 2 10:11:38 PDT 2011


string[2][] results;
results ~= ["foo", ""];
results ~= ["foobar", ""];

size_t len;
foreach (res; results)
{
    len = max(len, res[0].length);
}

That gives me '6'. I want to convert this to functional-style code
with reduce. I've tried:

len = reduce!(max!"a[0].length")(results);

That's not it. Any clues?


More information about the Digitalmars-d-learn mailing list