Problem with take(map())

bearophile bearophileHUGS at lycos.com
Fri Jul 29 17:03:25 PDT 2011


D2 code:


import std.stdio, std.algorithm, std.range;
auto foo(int p) {
    return map!((int n){ return p; })(iota(3));
}
void main() {
    writeln(take(foo(2), 20));
}


To me it prints:
[4221068, 4221068, 4221068]

Do you know if this is a known bug/problem?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list