21 Jan
2015
21 Jan
'15
10:09 p.m.
Chris Angelico wrote:
All of them allow you to write stuff like:
if (((1==1) + (1==0) + (0==0)) == 2)
Packing a number of booleans into an int is another case where bool-int equivalence comes in handy. I've found myself annoyed by this in Java on more than one occasion recently. (Java neither allows bools to be used as ints nor non-bools to be used directly as truth values.) -- Greg