The following statement compiles without errors in VS2015 community:
Code:
pointInNumber ? scCTX.SetState(SCE_DD_DEFAULT) : pointInNumber = true;
However, under GCC, I get the following error:
Code:
error: second operand to the conditional operator is of type 'void', but the third operand is neither a throw-expression nor of type 'void'
Also, g++ throws a warning on switch(bool) but MSVC seems to have no issues.
Could somebody explain the differences? Am I using the conditional operator in a wrong way? Also, is switch(bool) considered a bad programming practice? If so, why?