learncpp.com says:
(std::cout << (x > y)) ? x : y;
prints 1 (true) if x > y, or 0 (false) otherwise!
Experimentation on my computer shows that this is (unsurprisingly) correct.
However, I can't follow that logic.
std::cout << 0; returns std::cout in a healthy state
so std::cout << 0; should evaluate to true.
Also std::cout << 1; should evaluate to true;
So my expectation would be that (std::cout << (x > y)) ? x : y;
always prints 1
What am I missing?
Paul