You can’t read one byte
lol what. You can absolutely read one byte: https://godbolt.org/z/TeTch8Yhd
On ARM it's ldrb
(load register byte), and on RISC-V it's lb
(load byte).
Every decent compiler will turn booleans into words.
No compiler I know of does this. I think you might be getting confused because they're loaded into registers which are machine-word sized. But in memory a bool
is always one byte.
The biggest problem is that each element doesn't have a unique memory address; iterators aren't just pointers.