fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class BaseInterface
  5. { virtual void test()=0; }; // abstract class
  6.  
  7. class ExtendedInterface : public virtual BaseInterface // virtual inheritance
  8. {}; // abstract class
  9.  
  10. class Base : public virtual BaseInterface // virtual inheritance
  11. { void test() override {} }; // concrete class
  12.  
  13. class Extended : public ExtendedInterface, public Base // multiple
  14. {}; // thanks to virtual inheritance, concerete class
  15.  
  16. int main() {
  17. Extended e;
  18. return 0;
  19. }
Success #stdin #stdout 0s 3136KB
stdin
Standard input is empty
stdout
Standard output is empty