resizeable arrays: T[new]

Tom S h3r3tic at remove.mat.uni.torun.pl
Mon Jun 4 04:33:58 PDT 2007


Daniel Keep wrote:
> The "new" inside the brackets just looks strange; a new what?

I'm with you here ;)


> A few possible alternatives:
> 
> T[new]	// Proposed

Looks awkward, yeah. And it would produce false hits for anyone doing 
new-hunting (happens when you care about allocations, but prototype 
using 'new').


> T[$]	// Since $ already means "length" for arrays

I don't like it... Looks like an out of bounds error to my parser ;)


> T[*]	// Indicating the index could be anything

++votes;


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode



More information about the Digitalmars-d-announce mailing list