Interesting GCC extensions

Adam D. Ruppe destructionator at gmail.com
Mon Sep 28 20:14:07 PDT 2009


On Mon, Sep 28, 2009 at 09:04:27PM -0600, Rainer Deyke wrote:
> > 	int[101] a;
> > 	a[0..9] = 1;
> > 	a[10..99] = 2;
> > 	a[100] = 3;
> 
> This leaves elements 9 and 99 uninitialized.  I assume the gcc version
> does not.

That makes sense. I copied it literally without thinking. Easy enough fix.

I think this makes D's syntax superior. We can say a[0..$] where
gcc would have to use the more annoying a[0...$-1].
(pretending the $ worked of course)


-- 
Adam D. Ruppe
http://arsdnet.net



More information about the Digitalmars-d mailing list