But operator++() would be included in the precedence rules, since ++ is an operator, whereas SomeOtherFunc() isn't.
Originally Posted by iMalc
I haven't had to worry about precedence much in the past because I always use lots of parenthesis to be extremely explicit about how I want things evaluated. But since I started working with this crappy code at work, I found a ton of ambiguous statements like:
I'm sure the person who wrote it, meant for it to mean:
if ( rc = SomeFunc() == ERROR_SUCCESS )
but when I checked the precedence rules, I found it actually means:
if ( (rc = SomeFunc()) == ERROR_SUCCESS )
if ( rc = (SomeFunc() == ERROR_SUCCESS) )