open a range of files - segfault

Stephan Schiffels stephan_schiffels at mac.com
Wed May 22 01:38:13 PDT 2013


Hi,

this code crashes with a segfault. I need help to understand what 
might be wrong with it.

import std.array;
import std.algorithm;

void main() {
   auto names = ["file1.txt", "file2.txt", "file3.txt"];  // let 
these files exist
   auto files = names.map!(f => File(f, "r"))().array();
}

Thanks,

Stephan


More information about the Digitalmars-d-learn mailing list