Advertisement
AI_UBI

C++ Problem

Jul 19th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. struct ITool{};
  2.  
  3. template<typename T>
  4. struct ToolContainer : public ITool
  5. {
  6.     ITool *tool;
  7. };
  8.  
  9. class Tool
  10. {
  11.     ITool *owner_class;
  12. public:
  13.     template<typename T>
  14.     Tool(ToolContainer<T> *_owner_class) : owner_class(_owner_class){}
  15. }
  16.  
  17. class ToolLine : public Tool
  18. {
  19. public:
  20.     ToolLine() : Tool<ToolLine>(this) {}
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement