#include <set>
#include <iostream>
struct Base
{
Base(int xx, int yy) : x(xx), y(yy){}
bool operator<(const Base&) const {return true;}
int x;
int y;
};
struct D1 : Base
{
D1(int x, int y) : Base(x, y){}
};
struct D2 : Base
{
D2(int x = 0, int y = 0) : Base(x, y){}
};
void test()
{
std::set<D1> s1;
std::set<D2> s2;
s1.insert({1, 2});
s2.insert({1, 2});
std::cout<<"s1 size:"<<s1.size()<<std::endl<<"Content:"<<std::endl;
for(auto& v : s1)
{
std::cout<<v.x<<" "<<v.y<<std::endl;
}
std::cout<<std::endl<<"s2 size:"<<s2.size()<<std::endl<<"Content:"<<std::endl;
for(auto& v : s2)
{
std::cout<<v.x<<" "<<v.y<<std::endl;
}
}
int main()
{
test();
}
I2luY2x1ZGUgPHNldD4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKc3RydWN0IEJhc2UKewogICAgQmFzZShpbnQgeHgsIGludCB5eSkgOiB4KHh4KSwgeSh5eSl7fQogICAgYm9vbCBvcGVyYXRvcjwoY29uc3QgQmFzZSYpIGNvbnN0IHtyZXR1cm4gdHJ1ZTt9CgogICAgaW50IHg7CiAgICBpbnQgeTsKfTsKCnN0cnVjdCBEMSA6IEJhc2UKewogICAgRDEoaW50IHgsIGludCB5KSA6IEJhc2UoeCwgeSl7fQp9OwoKc3RydWN0IEQyIDogQmFzZQp7CiAgICBEMihpbnQgeCA9IDAsIGludCB5ID0gMCkgOiBCYXNlKHgsIHkpe30KfTsKCnZvaWQgdGVzdCgpCnsKICAgIHN0ZDo6c2V0PEQxPiBzMTsKICAgIHN0ZDo6c2V0PEQyPiBzMjsKCiAgICBzMS5pbnNlcnQoezEsIDJ9KTsKICAgIHMyLmluc2VydCh7MSwgMn0pOwoKICAgIHN0ZDo6Y291dDw8InMxIHNpemU6Ijw8czEuc2l6ZSgpPDxzdGQ6OmVuZGw8PCJDb250ZW50OiI8PHN0ZDo6ZW5kbDsKICAgIGZvcihhdXRvJiB2IDogczEpCiAgICB7CiAgICAgICAgc3RkOjpjb3V0PDx2Lng8PCIgIjw8di55PDxzdGQ6OmVuZGw7CiAgICB9CgogICAgc3RkOjpjb3V0PDxzdGQ6OmVuZGw8PCJzMiBzaXplOiI8PHMyLnNpemUoKTw8c3RkOjplbmRsPDwiQ29udGVudDoiPDxzdGQ6OmVuZGw7CiAgICBmb3IoYXV0byYgdiA6IHMyKQogICAgewogICAgICAgIHN0ZDo6Y291dDw8di54PDwiICI8PHYueTw8c3RkOjplbmRsOwogICAgfQp9CgppbnQgbWFpbigpCnsKICAgIHRlc3QoKTsKfQ==