std::cout << (true ? "high pass" : false ? "fail" : "pass")
is the same as
std::cout << (true ? "high pass" : (false ? "fail" : "pass"))
Since the ternary operator is right associative, why don't we perform the right-hand operation first? Shouldn't pass
be printed instead of high pass
?