Chapter 19. STL list

The standard template library (STL) supplies the programmer with a doubly linked list in the form of template class std::list.

In this lesson, you will learn

  • The characteristics of a std::list

  • Basic list operations

The Characteristics of a std::list

A linked list is a collection of nodes in which each node, in addition to containing a value or object of interest, also points to the next node; that is, each node links to the next one as the following visual representation in Figure 19.1 indicates.

Visual representation of a singly linked list.

Figure 19.1. Visual representation of a singly linked list.

In addition, in a doubly linked list as provided by STL, each node also points ...

Get Sams Teach Yourself C++ in One Hour a Day, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.