#include <iostream>
#include <list>
#include <utility>
#include <string>
using namespace std;

int main() {
	list<pair<string,int>> l0 { { "name1", 20 }, { "name2", 30 }, { "name3", 40 } };
//	for( auto &it : l0 )
//    	l0 . erase( it );	

    cout << "Containt of the list: "<<endl;
	for( auto &my_pair : l0 )
       cout <<"\t"<< my_pair.first << ":"<<my_pair.second<<endl; 
  
    cout << "Deleting content:"<<endl;      
	for (auto it=l0.begin(); it!=l0.end(); ) {
        cout <<"\t"<< it->first << ":"<<it->second<<"..."; 
    	it = l0.erase(it);  
    	cout << "remaining "<<l0.size()<< " - delete succesfull" <<endl;
	} 
    cout << "Size:"<< l0.size(); 

    return 0;
}