new T[10] => new T[](10)

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Feb 14 13:52:49 PST 2010


Now with the full legitimization of statically-sized array, the 
syntactic kludge "new T[10]" is more painful than ever.

Walter and I were talking about changing the semantics of "new T[10]" to 
mean "allocate a T[10] object and give me a pointer to it" and make the 
syntax "new T[](10)" mean "allocate an array of 10 elements and give me 
a handle to it."

I see major disruptions of existing code though. Do you guys have ideas 
of a clean migration path?


Andrei



More information about the Digitalmars-d mailing list