This is something that you could easily test, and you should have before asking.
Now the question is, did you actually try and figure it out?
Now, on to the question.
Even though it's not something people would normally do, it does actually work.
If you use code and check EVERY possible way things could be, then it will work EVERY time. Now, in this case that proof is simple since bool only has two values, true and false.
So, do something like this:
void main(){ bool bFalse = false; bool bTrue = true; bool bTest1, bTest2, bTest3; bTest1 = true; bTest1 &= bTrue; bTest2 = true; bTest2 = bTest2 & bTrue; bTest3 = true; bTest3 = bTest3 && bTrue; if( bTest1 == bTest2 && bTest1 == bTest3) std::cout << "True" <<endl; else std::cout << "False" << endl; bTest1 = false; bTest1 &= bTrue; bTest2 = false; bTest2 = bTest2 & bTrue; bTest3 = false; bTest3 = bTest3 && bTrue; if( bTest1 == bTest2 && bTest1 == bTest3) std::cout << "True" <<endl; else std::cout << "False" << endl; bTest1 = true; bTest1 &= bFalse; bTest2 = true; bTest2 = bTest2 & bFalse; bTest3 = true; bTest3 = bTest3 && bFalse; if( bTest1 == bTest2 && bTest1 == bTest3) std::cout << "True" <<endl; else std::cout << "False" << endl; bTest1 = false; bTest1 &= bFalse; bTest2 = false; bTest2 = bTest2 & bFalse; bTest3 = false; bTest3 = bTest3 && bFalse; if( bTest1 == bTest2 && bTest1 == bTest3) std::cout << "True" <<endl; else std::cout << "False" << endl;}
And then everything comes out great, then you are good to go.
In this case the output I got was:
True
True
True
True
So, it works. There ya go. Next time you can try thiskind of method before asking. Otherwise, if you can't figure it out this way, come on back.
- Bnty_Hntr