auto declarations

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Mon Jan 10 01:59:34 PST 2011


On Fri, 07 Jan 2011 16:30:24 -0800, Jonathan M Davis wrote:

> On Friday, January 07, 2011 13:32:42 Ellery Newcomer wrote:
>> auto a = 1, b = null;
>> 
>> int a = 1, *b = null;
>> 
>> 
>> [...]
> 
> [...]
> 
> However, I'm vere suprised that the first one succeeds. I think that it
> should be reported as a bug. All variables declared on the same line are
> supposed to have the same type.

If I remember correctly, TDPL explicitly states that you may use 
automatic type inference to declare variables of different types in one 
line.

-Lars


More information about the Digitalmars-d-learn mailing list