No subject


Thu Mar 29 20:50:10 PDT 2007


"If an auto Identifier is provided, it is declared and initialized to the 
value and type of the Expression. Its scope extends from when it is 
initialized to the end of the ThenStatement.

If a Declarator is provided, it is declared and initialized to the value of 
the Expression. Its scope extends from when it is initialized to the end of 
the ThenStatement. "

I can't understand what Declerator is.. I thought it would assign a 
previously defined variable, but that's not the case.

 if (auto r = true) {
  writefln(r); // OK
 }

 bool r;
 if (r = true) { // Error: '=' does not give a boolean result
  writefln(r);
 }


So... What is it then?




More information about the Digitalmars-d-learn mailing list