map with void fun

cal callumenator at gmail.com
Sat Apr 6 13:42:53 PDT 2013


Should the code below print anything (it currently doesn't)? I'm 
not sure I understand map:

import std.stdio, std.algorithm;	

void main() {
     int[] a = [1,2,3,4,5];
     auto r = a.map!( i => writeln(i) );
     while(!r.empty) r.popFront();
}


More information about the Digitalmars-d-learn mailing list