The Comma Operator's Deprecation Can't Come Soon Enough

Martin Krejcirik via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 15 11:08:14 PDT 2014


>
> Example?
>

For loop with multiple variables and various one liners of 
questionable utility aside:

import std.stdio;

bool funk()
{
     static int count;
     return ++count > 1 ? true : false;
}

void main()
{
     bool flag = false;
     if (flag && funk)
         writeln("a");
     else if (flag=true, flag && funk)
         writeln("b");
     else if (flag && funk)
         writeln("c");
}



More information about the Digitalmars-d mailing list