initializer list like in C++?

Jarrett Billingsley kb3ctd2 at yahoo.com
Tue Jul 24 06:25:29 PDT 2007


"Hoenir" <mrmocool at gmx.de> wrote in message 
news:f84rnt$1db0$1 at digitalmars.com...
> Is there anything like the initializer list (C++) in D?
>
> class Test {
> int x;
> Test(int y):x(y){};
> }

No.  See 
http://www.digitalmars.com/d/archives/digitalmars/D/initialization_lists_55262.html 
for an explanation on why D doesn't have them. 




More information about the Digitalmars-d-learn mailing list