Multi dimensional array question.

Tim Verweij tjverweij at gmail.com
Fri Jul 16 04:46:54 PDT 2010


On 16 July 2010 11:12, Heywood Floyd <soul8o8 at gmail.com> wrote:

> Lars T. Kyllingstad Wrote:
> (...)
>
> When we introduce templates, this should still work:
>
> struct MyArray(T){
>   array[3] T a;
> }
>
> // Let's try
> T == array[11] int
>
> array[3] T a;
> array[3] (array[11] int) a;
> array[3] array[11] a;
> array[3][11] a;
>
> a[0][10] = 9; //ok
>

The 'int' goes missing there. I guess you meant to write:

array[3] T a;
array[3] (array[11] int) a;
array[3] array[11] int a;
array[3][11] int a;

Right? Pretty nice. I must say that I quite like this. It does feel 'right'.

Groet,
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20100716/a53933fb/attachment.html>


More information about the Digitalmars-d-learn mailing list