multiple condition testing for equality in C++