IIRC, it's padding the class out to sizeof(int)
why? wouldn't that be wasting 3 bytes of memory? its not like bool uses them
Access/computation speed usually. The alignment of variables can make a difference. Padding to a boundary is pretty typical.
bool
doesn't exist to save memory. It exists as a seperate type from int
so you can overload on bool
.
In C and earlier versions of C++ there is no bool
, logical operations are of type int
.