you don't need to do this normally, and it is bloated and annoying to do it. can you explain exactly what you want to do (the above code does not need this level of messy code at all).
you can do it with a bitset or integer or other similar 'state' type variable, even an enum will work.
enum{empty, state1, state2, ....}
state &= (s1==s2)*state1;
state &= (s1==s3)*state2;
...
and then some logic after all that:
switch (state)
... //use fall through and breaks to group and organize the states
Operator overloading of those operators forces it to not short circuit.
(But, to be clear, this is not really considered a good thing. Probably counts as a 'code smell' to be overloading those operators. I've personally never done it.)