http://d.puremagic.com/issues/show_bug.cgi?id=4572
--- Comment #8 from bearophile_h...@eml.cc 2010-08-04 08:20:32 PDT --- Steven Schveighoffer: > Well, I would assume it would return an int[][], which probably would mean > nothing since arrays are pointer/length values, and any pointer/length values > read from a file would be bogus. I'd say read should reject reading elements > that have references in them. Yes, you are right, I probably meant a static array, so this reads a dynamic array of ints: std.file.read!(int[])(); A static array of two ints: std.file.read!(int[2])(); A static array of static array of ints (the memory of a fixed-size matrix is contiguous in D): std.file.read!(int[2][5])(); The problem is that such syntax doesn't read the items of the static array in-place, the result is a static array that gets copied. So you need an argument by ref: int[2][5] m; std.file.read(T)(ref T m); I don't like this a lot. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------