dsimcha Wrote:

> Funny, as simple as it is, this is a great idea for std.array because it 
> shortens the verbose cast(int) a.length to one extra character.  You 
> could even put an assert in it to check in debug mode only that the 
> conversion is safe.

> > int ilength(void[] a) @property
> > {
> >    return cast(int)a.length;
> > }

I'm not sure the code is correct. I have a vague impression that void[] is like 
byte[], at least, it's used as such, and conversion from int[] to byte[] 
multiplies the length by 4.

Reply via email to