Creating an array of default-constructed class instances

Ali Çehreli acehreli at yahoo.com
Sat Feb 9 22:57:41 PST 2013


On 02/09/2013 10:52 PM, Ali Çehreli wrote:

 >   auto things = iota(10).map!(i => new Thing(i))().array;

Actually, without the extra parentheses:

     auto things = iota(10).map!(i => new Thing(i)).array;

Ali



More information about the Digitalmars-d-learn mailing list