Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 12.6, effectively Boolean expressions in assignment?
#1
The second sentence in Rule 12.6 says \"Expressions that are effectively Boolean should not be used as operands to operators other than (&&, || and !).\"

This makes sense for most operators, but what about the simple assignment operator?

Code:
bool a;

a = (b == c); /* is this allowed? */

Perhaps a disclaimer \"other than assignment\" could be added?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)