How can I use UFCS for a loop

Tim tim.oliver at tutanota.com
Tue Jan 26 00:47:09 UTC 2021


Hi all,

How can I change the following to a more D-like approach by using 
UFCS?

>double[3] result;
>Json json = res.readJson;
>for(int i = 0; i < json.length; i++){
>     result[i] = json[i].to!double;
>}

I'd prefer to do something like:

>result = res.readJson[].map!(to!double);


More information about the Digitalmars-d-learn mailing list