Skip to content
jieqi's archive
Go back

C++: STL internals

std::deque isn’t a slower vector, std::map isn’t a hash table, and std::vector<bool> isn’t a vector. The differences are all layout, which is easier to look at than to remember.

Twenty-two types below, drawn from the inside: what sits inline, what’s on the heap, and what invalidates your iterators. Pick one and poke it.

It’s also on its own page if you want it full width.

Previous Post
C++: Initialisation Methods
Next Post
C++: Value categories