Changing the behavior of the comma operator

simendsjo simendsjo at gmail.com
Wed Mar 26 02:26:19 PDT 2014


On 03/26/2014 10:19 AM, Jason King wrote:
>>
>> The proposed change would allow the code above, but not this:
>>
>> for (x=1, y=2; x++, x < 10 && y < 20; y++) { ... }
>>
>>
>> Andrei
>
> After the change in D this code would generate a warning/error?
> If that's so then the "does the same as C code or fails to
> compile" objective is still being met.

(x++, x < 10) would be a void rather than bool if I understand 
correctly, so this wouldn't compile.



More information about the Digitalmars-d mailing list