On MSVC v9.0, if I do this:
int myvalue;
myvalue = true ? 1 : 0;
then it seems that ?: is evaluated before ‘=’. Is this a guarantee? I am using this table as a reference:
http://en.cppreference.com/w/cpp/language/operator_precedence
However, both operators are in the same row, so I’m not sure if they are evaluated in the order I expect or if this is guaranteed by the standard. Can anyone clarify this?
From your link:
Since both
=and?:are in the same cell and have right-to-left associativity, the ternary is guaranteed to evaluate first.