Can the expression evaluate to true in C++?
Yes, nothing is impossible...
struct A { int x = 0;};bool operator==(A& a, int num) { return ++a.x == num;}
Then:
if ((a == 1) && (a == 2) && (a == 3)) { std::cout << "meow"<< std::endl;}
prints meow
.
But I have no idea of any practical usage of such weird overloading and, hopefully, will never see such code in production.