Skip to content

why non-contiguous vector<bool> #3671

Discussion options

You must be logged in to vote

I have updated your post to add backticks, to prevent Markdown from eating angle brackets as HTML tags.

This was a notorious design decision in C++98; as I understand it, the partial specialization feature was new, and applying a space optimization to vector<bool> (making it store 8x less space) seemed like a good idea at the time. Its impact on generic code (and later concerns like multithreading) wasn't appreciated, and now it's too difficult to unwind (there have been attempts in the C++ Standardization Committee that have failed).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by StephanTLavavej
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants