Search⌘ K

Lists

Discover how to use the C++ std::list container effectively by understanding its doubly linked structure, special methods like merge, remove, splice, and unique, and its performance characteristics compared to vector and deque. Learn when to choose list for fast insertion and deletion with maintained iterator validity.

We'll cover the following...

std::list is a doubled linked list. std::list needs the header <list>.

Although it has a similar interface to std::vector or std::deque, std::list is quite different from both of them. That’s due to its structure.

std::list makes the following points unique:

  • It supports no random access.
...