#include #include #include using namespace std; int main() { list li; //born empty li.push_back(30); //Class vector has the same push_back function, li.push_front(10); //but not a push_front function. list::iterator it = li.begin(); //it refers to the 10. ++it; //Now it refers to the 30. li.insert(it, 20); //Insert a 20 before the 30. for (list::const_iterator it = li.begin(); it != li.end(); ++it) { cout << *it << "\n"; } return EXIT_SUCCESS; }