That would probably work by virtue of the fact that the only number that is all 0 bits is 0 itself, which would translate into a boolean false. However it would return true or false; not 1 or 0. Although I think an ostream automatically converts them to such...
Zhuge: Okay, if the values of true and false ever change to anything other than "not zero" and "zero" (such as "one" and "not one"), I'm sure OP will care then.