Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
std::list is an STL container implemented as a doubly-linked list.
std::list is suitable for constant-time random-access insertion and deletion at the cost of linear-time read and write.
-
Insertion operators, such as insert() and push_back() are often more efficient on a std::vector than on a std::list [1]
-
A std::list is relatively expensive to traverse [2]
-
A std::list usually has a four-word-per-element memory overhead [3]
- Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 31.6. Advice. page 924: '[3] Insertion operators, such as insert() and push_back() are often more efficient on a vector than on a list'
- Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 31.6. Advice. page 925: '[28] A list is relatively expensive to traverse'
- Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 31.6. Advice. page 925: '[29] A list usually has a four-word-per-element memory overhead'
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.
