forcing usage of bitwise and instead of boolean and
问题 In C++, a bool is guaranteed to be 0 or 1 C++ (§4.5/4): An rvalue of type bool can be converted to an rvalue of type int, with false becoming zero and true becoming one. Consider the following function and what g++5.2 generates with -O3 int foo(bool a, bool b) { if(a&b) return 3; else return 5; } 0000000000000000 <_Z3foobb>: 0: 40 84 ff test %dil,%dil 3: 74 13 je 18 <_Z3foobb+0x18> 5: 40 84 f6 test %sil,%sil 8: b8 03 00 00 00 mov $0x3,%eax d: 74 09 je 18 <_Z3foobb+0x18> f: f3 c3 repz retq 11: