Simulating rectangular array
Andrej Mitrovic
andrej.mitrovich at gmail.com
Sun Jun 17 12:50:32 PDT 2012
Has anyone come up with a template that can simulate a rectangular
array and allow one to override opAssign to do special work? E.g.:
Array!(2, 4) arr;
arr[1][3] = "foo";
This would invoke opAssign in some templated struct "Array". This
would be super-easy to implement if I had an opIndex that could work
with the above syntax. I know there's a "[1, 3]" syntax but I really
need the array "[1][3]" syntax.
Maybe Philippe has this in his templates book? (If not it would be a
great addition to it)
More information about the Digitalmars-d-learn
mailing list