Yes, but the standard does not provide a size, deliberately to allow for implementation specific specializations like this.
If you need individually addressed bytes that can be zero or non zero, there are easy ways to do that, this is making a big deal over nothing (also the bit wise versions have actual uses)
EDIT: Also the standard type is using a bit to define boolean (0 or 1) it's just that the smallest addressable value is a byte, so they have to stuff it into a byte.
This has absolutely nothing to do with the standard not specifying a concrete size. What is stored in a vector<bool> is not bool, flat out. So its size is irrelevant.
Bitwise bool collections do indeed have legitimate use cases, which is why they should have been included in the standard as their own independent type. Including them as a goofy specialization of vector<bool> causes very real problems with template metaprogramming and thread safety.
View all comments
Show parent comment
1
u/narrill 10d ago
A bool is also not a bit in C++, and
sizeof(bool)can never return one bit because a single bit isn't addressable.