fork download
  1. #include <memory>
  2.  
  3. struct IController
  4. {
  5. virtual void doS() = 0;
  6. };
  7.  
  8. struct IAnotherController
  9. : public IController
  10. {
  11. virtual void notDo() = 0;
  12. };
  13.  
  14. class Controller : public IAnotherController
  15. {
  16. public:
  17. void doS() {};
  18. void notDo() {};
  19. };
  20.  
  21. std::shared_ptr< IAnotherController >
  22. create()
  23. {
  24. return std::make_shared< Controller >();
  25. }
  26.  
  27.  
  28. int main() {
  29. std::shared_ptr< IController > ttt;
  30. ttt = create();
  31. }
  32.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Standard output is empty