Dynamic array length ABI unit

David Nadlinger via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 16 06:23:54 PDT 2014


On Monday, 16 June 2014 at 13:11:24 UTC, Luís Marques wrote:
> Ah, OK. I was mislead by the following:
>
> 	1: int[] a1 = [42];
> 	2: ubyte[] a2 = cast(ubyte[]) a1;
> 	3: writeln(a2);

Ah, that clears up the confusion. Array casts are "smart" and 
automatically divide down the length as needed, or fail otherwise.

David


More information about the Digitalmars-d mailing list