class Module { };
struct Port {
Module& owner;
Port(Module& owner) : owner(owner) {}
};
struct InPort : virtual Port { InPort(Module& m) : Port(m) { } };
struct OutPort : virtual Port { OutPort(Module& m) : Port(m) { } };
struct InOutPort : InPort, OutPort { InOutPort(Module& m) : Port(m), InPort(m), OutPort(m) { } };
int main() {
Module m;
InOutPort p(m);
}
Y2xhc3MgTW9kdWxlIHsgfTsKCnN0cnVjdCBQb3J0IHsKCU1vZHVsZSYgb3duZXI7CglQb3J0KE1vZHVsZSYgb3duZXIpIDogb3duZXIob3duZXIpIHt9Cn07CgpzdHJ1Y3QgSW5Qb3J0ICAgIDogdmlydHVhbCBQb3J0ICAgIHsgSW5Qb3J0KE1vZHVsZSYgbSkgOiBQb3J0KG0pIHsgfSB9OwpzdHJ1Y3QgT3V0UG9ydCAgIDogdmlydHVhbCBQb3J0ICAgIHsgT3V0UG9ydChNb2R1bGUmIG0pIDogUG9ydChtKSB7IH0gfTsKc3RydWN0IEluT3V0UG9ydCA6IEluUG9ydCwgT3V0UG9ydCB7IEluT3V0UG9ydChNb2R1bGUmIG0pIDogUG9ydChtKSwgSW5Qb3J0KG0pLCBPdXRQb3J0KG0pIHsgfSB9OwoKaW50IG1haW4oKSB7CglNb2R1bGUgbTsKCUluT3V0UG9ydCBwKG0pOwp9