#include <list>
#include <iostream>
struct A
{
A(int i) : I(i) {}
~A() { std::cout << I << std::endl; }
int I;
};
int main()
{
std::list<A> l;
l.push_back(A(1));
l.push_back(A(2));
l.push_back(A(3));
std::cout << "clearing list" << std::endl;
l.clear();
}
I2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCnN0cnVjdCBBCnsKICBBKGludCBpKSA6IEkoaSkge30KICB+QSgpIHsgc3RkOjpjb3V0IDw8IEkgPDwgc3RkOjplbmRsOyB9CiAgaW50IEk7Cn07CgppbnQgbWFpbigpCnsKICBzdGQ6Omxpc3Q8QT4gbDsKICBsLnB1c2hfYmFjayhBKDEpKTsKICBsLnB1c2hfYmFjayhBKDIpKTsKICBsLnB1c2hfYmFjayhBKDMpKTsKCiAgc3RkOjpjb3V0IDw8ICJjbGVhcmluZyBsaXN0IiA8PCBzdGQ6OmVuZGw7CiAgbC5jbGVhcigpOwp9Cg==