why non-contiguous vector<bool> #3671
-
greetings kind regards may i please inquire why non-contiguous vector was chosen ? it seems to me if |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
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).