
Effective C++
CppCast
00:00
The Problem With Forward Lists in the STL
forward list was adopted into the standard library specifically because there was a need for a data structure that had absolutely no time or space overhead compared to a singly linked list written in C. You can't even ask it how many elements are in the list. It doesn't support that because that would require an extra word to keep track of howMany elements are there. So again, I'm not opposed to the data structure. I just don't think it fits very well into the STL. In fact, I'm really looking forward to seeing what they do with concepts as regards. Let's put it this way. If you have, we think a forward list as a container. Yes. But
Transcript
Play full episode