fork download
  1. #include <iostream>
  2. using namespace std;
  3. class Interface
  4. {
  5. public:
  6. Interface() = default;
  7. virtual ~Interface() = default;
  8. Interface(const Interface&) = delete;
  9. Interface& operator=(const Interface&) = delete;
  10. Interface(Interface&&) = delete;
  11. Interface& operator=(Interface&&) = delete;
  12.  
  13. virtual void Foo() = 0;
  14. };
  15. class Derived : public Interface
  16. {
  17. public:
  18. void Foo() override
  19. {
  20. cout<<"@@"<<endl;
  21. }
  22. };
  23. int main() {
  24.  
  25. Interface* impl = new Derived();
  26. impl->Foo();
  27. // your code goes here
  28. return 0;
  29. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
@@