I'm having a bit of trouble using array from std.array to convert a MapResult to a specific array type. My problem is as follows:
I have an array a of objects, each of which has a publically-accessible field val. I would like to use map from std.algorithm to go over a and return an array of all the values of the val members. My code looks something like this:
import std.algorithm:map;
import std.array:array;
//import for my object type, which I call Box here
ulong[] fun (Box[] a) {
return array!(ulong[])(map!(function ulong(Box x) {return x.val;})(a);
}
However, when I try to do this, the compiler gives me an error saying that array cannot deduce the function from the argument types !(ulong[])(MapResult!(_funcliteral3,Box[])). Does that mean that MapResults aren't ranges, and is there a way to get what I want?