Empty array and AA literals

JR sunspyre at gmail.com
Sun Apr 6 12:48:36 PDT 2014


On Sunday, 6 April 2014 at 09:52:04 UTC, monarch_dodra wrote:
> An Dynamic Array is merelly a "fat pointer" that holds both 
> pointer and length. There is no need to create or new a Dynamic 
> Array.

new allows for setting the length immediately, though.

      auto arr = new int[](99);
      // arr.length = 99;  // avoided this


Does doing it in two steps allocate twice?


More information about the Digitalmars-d-learn mailing list