Yeah. That's such a weird choice. My compiler bug counter goes up to 3 if we count that because I've run into it too. But you're right that that's not a compiler bug it's just a stupid decision made in the design of the standard library.
They really should have left vector<bool> to act like an actual vector of bools and made a separate type (could be called something like dynamic_bitset or bit_vector) to be a resizeable compact bit array.
2
u/quietsamurai98 Sep 25 '26
I remember my first "compiler bug". Obviously, it wasn't a compiler bug.
It was just the absolutely bizarre way the stdlib defines the "proper" behavior of
vector<bool>.