#include <iostream>
#include <list>
#include <algorithm>
#include <numeric>
using namespace std;
void print (list<int>& l)
{
list<int>::iterator It = l.begin();
while ( It != l.end() )
{
cout << *(It++) << " ";
}
cout << endl;
}
//===============================
int main ()
{
list<int> li1(5), li2(5);
iota(li1.begin(),li1.end(),1);
iota(li2.begin(),li2.end(),5);
cout << "li1 : ";
print(li1);
cout << "li2 : ";
print(li2);
li1.swap(li2);
cout << endl <<"After swapping:" << endl;
cout << "li1 : ";
print(li1);
cout << "li2 : ";
print(li2);
getchar();
return 0;
}