|If you want the first element of a list you can use
list.front() and for the last element
push_front() function adds elements at the start of the list and
push_back() adds them at the end.
The list doesn't start off with any fixed length, it grows and shrinks as you add and remove elements.
So if I was adding two items to a list I would do something like this:
ItemType item1, item2;
You should use
insert() when you want to add an item in the middle of the list - the iterator you pass in should point to the element you want to insert the new item in front of.