resizeable arrays: T[new]

Lionello Lunesu lio at lunesu.remove.com
Mon Jun 4 04:46:15 PDT 2007


Tom S wrote:
> 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').

Huh. To me, that sounds like an argument *for* using [new], since any 
array passed as [new] can cause an allocation in that function.

I like the [new] syntax :P

L.



More information about the Digitalmars-d-announce mailing list