Advertisement
igagis

Untitled

Feb 23rd, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. class Shared : public std::enable_shared_from_this<Shared>{
  5. public:
  6. int prea;
  7. };
  8.  
  9. class Widget : public virtual Shared{
  10. int a;
  11. public:
  12. ~A(){
  13. a = 7;
  14. }
  15. };
  16.  
  17. class Container : virtual public Widget{
  18. };
  19.  
  20. class List : private Container, virtual public Widget{
  21. public:
  22. int c;
  23. };
  24.  
  25.  
  26. int main(int argc, char** argv){
  27. auto c = std::make_shared<List>();
  28. c->c = 3;
  29.  
  30. std::cout << c->c << std::endl;
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement