#include <string>
#include <list>
#include <iostream>
struct A {
std::string name;
A(const std::string& name) : name(name) {}
bool operator< (const A& right) const { return name < right.name; }
};
int main()
{
std::list<A> list = {A("c"), A("a"), A("b")};
list.sort();
// ideone.com's compiler is rather old
// for(auto a : list)
// std::cout << a.name << '\n';
for(auto i = list.begin(); i!=list.end(); ++i)
std::cout << i->name << '\n';
}
I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDxpb3N0cmVhbT4Kc3RydWN0IEEgewogICAgc3RkOjpzdHJpbmcgbmFtZTsKICAgIEEoY29uc3Qgc3RkOjpzdHJpbmcmIG5hbWUpIDogbmFtZShuYW1lKSB7fQogICAgYm9vbCBvcGVyYXRvcjwgKGNvbnN0IEEmIHJpZ2h0KSBjb25zdCB7IHJldHVybiBuYW1lIDwgcmlnaHQubmFtZTsgfQp9OwoKaW50IG1haW4oKQp7CiAgICBzdGQ6Omxpc3Q8QT4gbGlzdCA9IHtBKCJjIiksIEEoImEiKSwgQSgiYiIpfTsKICAgIGxpc3Quc29ydCgpOwoKLy8gaWRlb25lLmNvbSdzIGNvbXBpbGVyIGlzIHJhdGhlciBvbGQKLy8gICAgZm9yKGF1dG8gYSA6IGxpc3QpCi8vICAgICAgICBzdGQ6OmNvdXQgPDwgYS5uYW1lIDw8ICdcbic7CiAgICBmb3IoYXV0byBpID0gbGlzdC5iZWdpbigpOyBpIT1saXN0LmVuZCgpOyArK2kpCiAgICAgICAgc3RkOjpjb3V0IDw8IGktPm5hbWUgPDwgJ1xuJzsKfQo=