A vector<bool>
is specialized to reduce space consumption (1 bit for each element), but it's slower to access than vector<char>
. Sometimes I use a vector<char>
for performance reason, but if I convert a char
to a bool
, my compiler (Visual C++) may generate a C4800 warning which I don't like.
Also, I think the vector<char>
is semantically wrong if I treat it as unspecialized vector<bool>
. So, can I get a real unspecialized vector<bool>
type in C++?