C++ does use short-circuit logic, so if bool1
is false, it won't need to check bool2
.
This is useful if bool2 is actually a function that returns bool, or to use a pointer:
if ( pointer && pointer->someMethod() )
without short-circuit logic, it would crash on dereferencing a NULL pointer, but with short-circuit logic, it works fine.