I have the following piece of code,
if (index > ((v.size() >> 1) - 1)) { }
v.size() is 0 and index is 1. The execution does not get into the if block. But if I change the above code to,
int limit = (v.size() >> 1) - 1;
if (index > limit) { }
and with the same values of v.size() and index, the execution does get into the if block.
Why does this behavior happen? Thanks.