Is there any performance difference in situations when bool
is initialized with a value different from 0
and 1
?
I have read in Optimizing C++ by Agner Fog that:
Boolean variables are overdetermined in the sense that all operators that have Boolean variables as input check if the inputs have any other value than 0 or 1, but operators that have Booleans as output can produce no other value than 0 or 1. This makes operations with Boolean variables as input less efficient than necessary.
Can anybody explain what does it mean?