On Friday, 8 March 2013 at 23:51:48 UTC, bearophile wrote:
Andrea Fontana:
Here the answer:
auto r=iota(100).map!((x) => uniform(0,10))();
writeln(r.front," ", r.front, " ", r.front, " ", r.front);
I think that's not the answer. I think the answer is a bug in
filter().
Bye,
bearophile
My struct version never work if map doesn't cache. Every time I
call (inside popFront() too!) front() gives different values.
If i do array.distinct() it works fine: an array is filled with
random values and they will never changes again.