#include <iostream>
#include <list>
#include <algorithm>
#include <numeric>
using namespace std;
template <class T>
void print (list<T>& l)
{
list<int>::iterator It = l.begin();
while ( It != l.end() )
{
cout << *(It++) << " ";
}
cout << endl;
}
//=====================
int main ()
{
list<int> li(10);
iota(li.begin(),li.end(),1);
print(li);
list<int>::iterator It;
It = find(li.begin(),li.end(),6);
// erase at the pos It
li.erase(It);
print(li);
It = find(li.begin(),li.end(),4);
// erase from beginning to the pos It
li.erase(li.begin(),It);
print(li);
getchar();
return 0;
}