fork download
  1. #include <iostream>
  2.  
  3. class Sprite
  4. {
  5. public:
  6. Sprite() : d_value(0) {}
  7.  
  8. void method1() { std::cout << "Sprite::method1()\n"; }
  9. void method2() { std::cout << "Sprite::method2()\n"; }
  10.  
  11. int d_value;
  12. };
  13.  
  14. class Wrapper : private Sprite
  15. {
  16. public:
  17. using Sprite::method1;
  18. using Sprite::method2;
  19. using Sprite::d_value;
  20. };
  21.  
  22. int main()
  23. {
  24. Wrapper w;
  25. w.method1();
  26. w.method2();
  27. w.d_value = 3;
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0.01s 5444KB
stdin
Standard input is empty
stdout
Sprite::method1()
Sprite::method2()