Is there an elegant way of making a Result eager instead of lazy?

bearophile bearophileHUGS at lycos.com
Tue Mar 20 10:50:22 PDT 2012


simendsjo:

> std.array includes a method, array(), for doing exactly this:
> int[] test2 = array(map!"a+a"(test1)); //eager

With 2.059 you can write that also in a more readable way, because there is less nesting:

int[] test2 = test1.map!q{a + a}().array();

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list