fork download
  1. class AbstractBaseClass
  2. {
  3. public:
  4.  
  5. virtual void DoAThing( const char* withThis ) {}
  6. virtual void DoAThing( const char* const* withThat ) = 0;
  7.  
  8. AbstractBaseClass() {}
  9. virtual ~AbstractBaseClass() {}
  10. };
  11.  
  12. class SomeMiddlewareClass : public AbstractBaseClass
  13. {
  14. public:
  15.  
  16. void ThisIsCool() {}
  17.  
  18. SomeMiddlewareClass() {}
  19. virtual ~SomeMiddlewareClass() {}
  20. };
  21.  
  22. class SomeEndClass : public SomeMiddlewareClass
  23. {
  24. public:
  25.  
  26. using SomeMiddlewareClass::DoAThing;
  27. void DoAThing( const char* const* withThat ) {}
  28.  
  29. SomeEndClass() {}
  30. virtual ~SomeEndClass() {}
  31. };
  32.  
  33. int main()
  34. {
  35. SomeEndClass* myClass = new SomeEndClass();
  36.  
  37. myClass->DoAThing( "withThis" );
  38. ((SomeMiddlewareClass*)myClass)->DoAThing( "withThisToo" );
  39.  
  40. delete myClass;
  41. }
  42.  
Success #stdin #stdout 0s 2980KB
stdin
Standard input is empty
stdout
Standard output is empty