fork(1) download
  1. class Module { };
  2.  
  3. struct Port {
  4. Module& owner;
  5. Port(Module& owner) : owner(owner) {}
  6. };
  7.  
  8. struct InPort : virtual Port { InPort(Module& m) : Port(m) { } };
  9. struct OutPort : virtual Port { OutPort(Module& m) : Port(m) { } };
  10. struct InOutPort : InPort, OutPort { InOutPort(Module& m) : Port(m), InPort(m), OutPort(m) { } };
  11.  
  12. int main() {
  13. Module m;
  14. InOutPort p(m);
  15. }
Success #stdin #stdout 0s 3092KB
stdin
Standard input is empty
stdout
Standard output is empty