Published: 13 September 2022
Tags: c++, containers
Evgeny Shulgin does a deep-dive on a number of the containers in C++, including array, vector, fbvector, deque, forward_list, list, and more obscure ones. There are also useful graphics to help conceptualize the containers.
- std::vector is the most popular container. It is similar to arrays, but may dynamically resize itself
- folly::fbvector is an implementation of std::vector with additional features and better performance
- std::deque is a double-ended queue. It is implemented as a sequence of fixed-size arrays.
- std::forward_list is a singly linked list, the easiest implementation of the linked list
- std::list is a more complex implementation of the linked list where nodes can reference previous nodes, and it also supports fast insertion of elements at the end of the list