fork(2) download
class Module { };

struct Port {
	Module& owner;
	Port(Module& owner) : owner(owner) {}
};

struct InPort    : virtual Port    { using Port::Port; };
struct OutPort   : virtual Port    { using Port::Port; };
struct InOutPort : InPort, OutPort { InOutPort(Module& m) : Port(m), InPort(m), OutPort(m) { } };

int main() {
	Module m;
	InOutPort p(m);
}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor 'InOutPort::InOutPort(Module&)':
prog.cpp:10:90: error: use of deleted function 'InPort::InPort(Module&)'
 struct InOutPort : InPort, OutPort { InOutPort(Module& m) : Port(m), InPort(m), OutPort(m) { } };
                                                                                          ^
prog.cpp:8:50: note: 'InPort::InPort(Module&)' is implicitly deleted because the default definition would be ill-formed:
 struct InPort    : virtual Port    { using Port::Port; };
                                                  ^
prog.cpp:8:50: error: no matching function for call to 'Port::Port()'
prog.cpp:8: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
prog.cpp:10:90: error: use of deleted function 'OutPort::OutPort(Module&)'
 struct InOutPort : InPort, OutPort { InOutPort(Module& m) : Port(m), InPort(m), OutPort(m) { } };
                                                                                          ^
prog.cpp:9:50: note: 'OutPort::OutPort(Module&)' is implicitly deleted because the default definition would be ill-formed:
 struct OutPort   : virtual Port    { using Port::Port; };
                                                  ^
prog.cpp:9:50: error: no matching function for call to 'Port::Port()'
prog.cpp:9: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