[Issue 10638] Assignment can't be used as a condition

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 14 04:48:32 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10638


9999 <mailnew4ster at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mailnew4ster at gmail.com


--- Comment #1 from 9999 <mailnew4ster at gmail.com> 2013-07-14 04:48:30 PDT ---
I believe the primary reason is to prevent bugs where == was meant and not =.
Usually, what you want to do is:

void main()
{
    int i = f();
    if (i == 1)
    {
        //......
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list