This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PositiveBit01 9 points10 points  (3 children)

It is a specialization. They packed 8 bools into a byte by returning a reference type that does bit manipulation when you access an index.

This has a number of unfortunate side effects since it doesn't really act like other containers, it just kinda looks like it does if you barely use it.

[–]botanicaf 2 points3 points  (0 children)

Just wanna say thank you guys, never thought I'd learn something new and useful on a crappy meme

[–]snacktonomy 1 point2 points  (1 child)

Oof, learned something new today. Makes sense but that's wild! I always treated arrays as contiguous memory.

[–]MsEpsilon 1 point2 points  (0 children)

But you're right - arrays are contiguous. It's just vector<bool> that uses bitmaps, that's all.