Content deleted Content added
Line 357:
[[User:Duoas|Duoas]] ([[User talk:Duoas|talk]]) 22:06, 6 May 2014 (UTC)
== Wrong operator precedence with ternary- and assign-operator ==
The precedence table says that the ternary-operator has higher precedence than the assign-operator, so "a ? b : c = 1" should be evaluated like "(a ? b : c) = 1". In reality it is evaluated like "a ? b : (c = 1)". So the precedence table looks wrong.
See:
http://stackoverflow.com/questions/7499400/ternary-conditional-and-assignment-operator-precedence
and
http://en.cppreference.com/w/cpp/language/operator_precedence
|