Auto syntax revisited

Fredrik Olsson peylow at treyst.se
Wed Feb 22 02:36:34 PST 2006


Don Clugston skrev:
> Fredrik Olsson wrote:
>> AgentOrange skrev:
>>> In article <ops5bhg5ol23k2f5 at nrage.netwin.co.nz>, Regan Heath says...
<snip>
>> Plus with: auto a = A();
>> It is absolutely no way to just at a glance make sure with 100% 
>> sertenty that a is not assigned the result of a function, instead of 
>> being instantiated on the stack.
> 
> Does that matter? After all, a constructor is just a function. Clearly a 
> new variable 'a' is being declared, it's type will be the return value 
> of A(), and then A() needs to be called to initialise it.
> Or have I missed something?

Not really. I just like to be able to see with a glance what my code 
does. I think it is good for productivity, code maintenance, and in 
general make the programming language look nice.

// Fredrik



More information about the Digitalmars-d mailing list