The list container is a linked list and is constructed in the same way as a vector and deque. The resizing and empty test is the same as for a vector (or deque), and you also have access to the front and the back of the list using the same operators as the deque.
Where the list is different is in the various splicing operations that it can support. These splicing operations allow you to move elements from one list to another—no elements are created or destroyed, but the lists grow or shrink in order to accommodate the changed data.
The basic use for the splice operator is as follows:
list<char> my_string; // an empty list list<char> my_other_string ( 10, 'a ' ); // a list of 'a ' splice ( my_string.begin( ), my_other_string );
This code ...