- C++17 STL Cookbook
- Jacek Galowicz
- 64字
- 2025-04-04 19:00:06
List storage
The std::list is a classical doubly-linked list. Not less, and not more. If only uni-directional list traversal is needed, std::forward_list may be more performant in both space and maintenance complexity, because it maintains only list item pointers in one direction. Lists can only be traversed linearly with O(n) time. Inserting and removing items at specific positions can be done in O(1) time.