Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. struct Base{
  2. int x=0;
  3. };
  4.  
  5. struct Derived : public Base {
  6. static int myint =1;
  7. Derived(){x+=myint;}
  8. };
  9.  
  10. struct Derived2 : public Derived {
  11. static int myint = 2;
  12. Derived2(){x+=myint;}
  13. };
  14.  
  15. template<class A>
  16. struct BaseX : public Base {
  17. static int myint;
  18. BaseX() {Base::x+=myint;}
  19. }
  20.  
  21. struct Derived : public BaseX<Derived>;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement