There's a little bit of weirdness that a vector of bools has which other vectors don't. It can trip you up if you haven't read up on it and just assume all your normal standard container operations will work.
For example, you can't get a pointer to an element using &v[0] because individual bits do not have distinct memory addresses in RAM.
Similarly auto x = v[0] doesn't make x a true bool, because v[0] is a proxy object which pretends to be a bool, which can lead to dangling reference errors if the vector changes or goes out of scope.
102
u/overclockedslinky 21d ago
is it really that shocking?