DIP80: phobos additions

Dennis Ritchie via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 15 06:44:50 PDT 2015


On Monday, 15 June 2015 at 10:00:43 UTC, Ilya Yaroshenko wrote:
> N-dimensional slices is ready for comments!

It seems to me that the properties of the matrix require `row` 
and `col` like this:

import std.stdio, std.experimental.range.ndslice, std.range : 
iota;

void main() {

     auto matrix = 100.iota.sliced(3, 4, 5);
	
     writeln(matrix[0]);
     // [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9], [10, 11, 12, 13, 14], 
[15, 16, 17, 18, 19]]

     // writeln(matrix[0].row); // 4
     // writeln(matrix[0].col); // 5
}

P.S. I'm not exactly sure that these properties should work 
exactly as in my code :)


More information about the Digitalmars-d mailing list