The demise of T[new]

dsimcha dsimcha at yahoo.com
Mon Oct 19 07:14:02 PDT 2009


== Quote from downs (default_357-line at yahoo.de)'s article
> Walter Bright wrote:
> > Ary Borenszweig wrote:
> >> I remember seeing a lot of CTFE code that created a dynamic array and
> >> then appended stuff to it, like for example to build a list of prime
> >> numbers. Would that still work with ArrayBuilder?
> >
> > Probably not. But you can rewrite:
> >
> >   a ~= stuff;
> >
> > as:
> >
> >   a = a ~ stuff;
> >
> > to make it work.
> Is there any reason the first can't be a short-hand for the second?

Devil's advocate because I somewhat agree with you:  a = a ~ stuff; is so
inefficient that it should be ugly.



More information about the Digitalmars-d mailing list