D with experimental features like tuple unpacking

renoX renozyx at gmail.com
Fri Mar 22 06:41:30 PDT 2013


> The fact that you sort of can't easily index tuple of 3 ints as 
> a fixed array of 3 ints is a clear indication of a tendency 
> that I find disturbing.

But there is a reason for this: tuple/structs can contain 
heterogeneous type whereas array contains only homogeneous type..
So if you want to index a tuple/struct of say {int,int[128]} you 
have to build an array of pointers to these index, possible but 
clearly not free..
So I wouldn't agree that tuple/struct are 'trivially 
substitutable' to array..



More information about the Digitalmars-d mailing list