Avoid casting int to bool in c++.