Woldemort Type can't even call "take" or "array"
kerdemdemir via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun May 31 00:23:53 PDT 2015
auto outputString = (char[][] inParam) =>
(inParam[0].length == 0 || target.startsWith(inParam[0])) &&
(inParam[1].length == 0 || target.endsWith(inParam[1]));
auto numArr = threeDArr.filter!(a => a[0].canFind('?')).
filter!(a => outputString(a[0].split('?'))).
map!"to!int(a[1])";
writeln(numArr);
I don't want to get into details of my code and bore you.It takes
a 3d array like below:
[["201212?4", "64"], ["20121235", "93"], ["2012123?", "87"],
["2012?234", "75"]]
And returns range of numbers like :
[64, 87, 75]
Now I want to find the maximum of this range "numArr". Since I
couldn't find a "max" function works on ranges I decided to sort
them and take the first element.
But when I tried to sort like numArr.sort();
Error: template std.algorithm.sorting.sort cannot deduce function
from argument types !()(MapResult!(unaryFun,
FilterResult!(__lambda3, FilterResult!(__lambda2, char[][][])))).
Ok I said I will first copy the range to array then use sort. So
I tried numArr.array
Error: no property 'array' for type 'MapResult!
Now only thing I can do with the range I have to call
writeln();Why other functions of standart library are not working
with this range type?
More information about the Digitalmars-d-learn
mailing list