For bool
, it's 8 bit while has only true and false, why don't they make it single bit.
And I know there's bitset
, however it's not that convenient, and I just wonder why?
The basic data structure at the hardware level of mainstream CPUs is a byte. Operating on bits in these CPUs require additional processing, i.e. some CPU time.
The same holds for bitset
.