Why there isn't a single bit data type in C/C++?

iloahz picture iloahz · Oct 12, 2013 · Viewed 26.2k times · Source

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?

Answer

Igor Popov picture Igor Popov · Oct 12, 2013

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.