#include //for the object cout #include //for teh macro EXIT_SUCCESS #include //for class list using namespace std; int main() { list li; //born empty, but can hold ints li.push_front(10); //Insert at front of list. li.push_back(30); //Insert at end of list. auto it {begin(li)}; //Iterator points at the first element of the list. ++it; //Iterator points at the second element of the list li.insert(it, 20); //Insert 20 immediately before the second element. cout << "The list contains " << li.size() << " elements.\n\n"; for (auto el: li) { //Output all the elements of the list. cout << el << "\n"; } return EXIT_SUCCESS; }