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 { using Port::Port; };
  9. struct OutPort : virtual Port { using Port::Port; };
  10. struct InOutPort : InPort, OutPort { using Port::Port; };
  11.  
  12. int main() {
  13. Module m;
  14. InOutPort p(m);
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:14:15: error: use of deleted function 'InOutPort::InOutPort(Module&)'
  InOutPort p(m);
               ^
prog.cpp:10:50: note: 'InOutPort::InOutPort(Module&)' is implicitly deleted because the default definition would be ill-formed:
 struct InOutPort : InPort, OutPort { using Port::Port; };
                                                  ^
prog.cpp:10:50: error: use of deleted function 'InPort::InPort()'
prog.cpp:8:8: note: 'InPort::InPort()' is implicitly deleted because the default definition would be ill-formed:
 struct InPort    : virtual Port    { using Port::Port; };
        ^
prog.cpp:8:8: error: no matching function for call to 'Port::Port()'
prog.cpp:8:8: note: candidates are:
prog.cpp:5:2: note: Port::Port(Module&)
  Port(Module& owner) : owner(owner) {}
  ^
prog.cpp:5:2: note:   candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(const Port&)
 struct Port {
        ^
prog.cpp:3:8: note:   candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(Port&&)
prog.cpp:3:8: note:   candidate expects 1 argument, 0 provided
prog.cpp:10:50: error: use of deleted function 'OutPort::OutPort()'
 struct InOutPort : InPort, OutPort { using Port::Port; };
                                                  ^
prog.cpp:9:8: note: 'OutPort::OutPort()' is implicitly deleted because the default definition would be ill-formed:
 struct OutPort   : virtual Port    { using Port::Port; };
        ^
prog.cpp:9:8: error: no matching function for call to 'Port::Port()'
prog.cpp:9:8: note: candidates are:
prog.cpp:5:2: note: Port::Port(Module&)
  Port(Module& owner) : owner(owner) {}
  ^
prog.cpp:5:2: note:   candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(const Port&)
 struct Port {
        ^
prog.cpp:3:8: note:   candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(Port&&)
prog.cpp:3:8: note:   candidate expects 1 argument, 0 provided
prog.cpp:10:50: error: no matching function for call to 'Port::Port()'
 struct InOutPort : InPort, OutPort { using Port::Port; };
                                                  ^
prog.cpp:10:50: note: candidates are:
prog.cpp:5:2: note: Port::Port(Module&)
  Port(Module& owner) : owner(owner) {}
  ^
prog.cpp:5:2: note:   candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(const Port&)
 struct Port {
        ^
prog.cpp:3:8: note:   candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(Port&&)
prog.cpp:3:8: note:   candidate expects 1 argument, 0 provided
stdout
Standard output is empty