#include
#include
using namespace std;
void PrintListContents (const list & listInput);
int main ()
{
list list1;
list1.insert (list1.begin (), 4);
list1.insert (list1.begin (), 3);
list1.insert (list1.begin (), 2);
list1.insert (list1.begin (), 1);
list1.insert (list1.end (), 5);
PrintListContents (list1);
list list2;
list2.insert (list2.begin (), 4, 0);
cout << list2.size () << "' elements of a value:" << endl;
PrintListContents (list2);
list listIntegers3;
// Inserting elements from another list at the beginning...
listIntegers3.insert (listIntegers3.begin (),list1.begin (), list1.end ());
return 0;
}
void PrintListContents (const list & listInput)
{
std::list ::const_iterator i;
for ( i = listInput.begin (); i != listInput.end (); ++ i )
cout << *i << endl;
}