Top 5

Sergey Gromov snake.scaly at gmail.com
Fri Oct 10 12:26:09 PDT 2008


Fri, 10 Oct 2008 13:24:51 -0500,
Andrei Alexandrescu wrote:
> Jarrett Billingsley wrote:
> > What Andrei is implying, then is that for dynamic arrays, we should
> > have to use the (already-legal) "new T[](n)" form, and "new T[x]"
> > would mean to allocate a statically-sized array on the heap.
> 
> Well yah but I think this will confuse people coming from C++. I just 
> wish new was abolished entirely:
> 
> struct S {}
> auto a = S();
> auto b = Object();
> auto c = char[](15);
> auto d = char[15]();
> 
> So in general Type followed by "(" ...optional arguments... ")" yields a 
> value.

Type constructors?  Nice.  You will have a hard time justifying the 
delete keyword though.



More information about the Digitalmars-d mailing list