dmd-2.067.0-b1

Gary Willoughby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 13 06:07:21 PST 2015


On Friday, 13 February 2015 at 09:38:04 UTC, Dennis Ritchie wrote:
> This is a bug?
>
> import std.stdio;
>
> void main() {
>     int a = 0;
>
>     writeln( (a < 10) ? a = 1 : a = 2 );    // prints 2
>
>     writeln( (a < 10) ? a = 1 : (a = 2) );  // prints 1
> }
>
> Even C++ output:
> 1
> 1

Maybe a similar issue as this: 
http://forum.dlang.org/thread/wlpmjgbkdzcyuuyafzwk@forum.dlang.org


More information about the Digitalmars-d-learn mailing list